Top "Pattern-matching" questions

Use this tag for questions about testing whether a data structure has a particular shape or contains particular values in certain locations.

Pattern Matching `@` Symbol

Given this Person case class: scala> case class Person(name: String, age: Int) {} defined class Person ... and this instance …

scala pattern-matching
Wildcard string matching in Ruby

I'd like to write a utility function/module that'll provide simple wildcard/glob matching to strings. The reason I'm not …

ruby pattern-matching glob string-matching
Pattern matching on the beginning of a string in f#

I am trying to match the beginning of strings in f#. Not sure if I have to treat them as …

f# pattern-matching
Scala: short form of pattern matching that returns Boolean

I found myself writing something like this quite often: a match { case `b` => // do stuff case _ => // do nothing } …

scala pattern-matching
Getting all mailto links with jQuery

I need a pattern that will traverse the document and get me all links that have mailto in their href: &…

jquery pattern-matching mailto
scala either pattern match

what is wrong in this piece of code? (Left("aoeu")) match{case Right(x) => ; case Left(x) => } <…

scala pattern-matching scala-2.8
Case Statements and Pattern Matching

I'm coding in SML for an assignment and I've done a few practice problems and I feel like I'm missing …

functional-programming pattern-matching case sml
Pattern match function against empty map

I'm playing around with pattern match and I found out, that it's not quite easy to pattern match parameters of …

pattern-matching elixir
When would you use KMP over BOYER-MOORE

I am currently learning about pattern matching algorithms and have come across these two algorithms. I have the following general …

algorithm pattern-matching boyer-moore knuth-morris-pratt
Scala: Mix traits and case class in pattern match

I want to match on some case classes. If I don't know them, I want to match on a specified …

scala pattern-matching traits case-class