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.

Pyspark string pattern from columns values and regexp expression

Hi I have dataframe with 2 columns : +----------------------------------------+----------+ | Text | Key_word | +----------------------------------------+----------+ | First random text tree cheese cat | tree | | …

regex pyspark pattern-matching callable-object
Expression of type T cannot be handled by a pattern of type X

I have upgraded my project to target C# 7 and used Visual Studio 2017 RC to implement pattern matching across my solution. …

c# pattern-matching visual-studio-2017 c#-7.0
How to detect if a repeating pattern exists

My question isn't language specific... I would probably implement this in C# or Python unless there is a specific feature …

algorithm pattern-matching pseudocode
Scala: Case class unapply vs a manual implementation and type erasure

I'm trying to understand what Scala does with Case Classes that makes them somehow immune to type erasure warnings. Let's …

scala pattern-matching type-erasure case-class unapply
Query performance with concatenation and LIKE

Can someone explain the performance difference between these 3 queries? concat() function: explain analyze select * from person where (concat(last_name, …

sql postgresql pattern-matching concatenation postgresql-performance
Pattern matching in graphs

I'm trying to find tool/algorithm for searching sections that corresponds to specified pattern in oriented graph, e.g.: A-&…

python graph pattern-matching subgraph isomorphism
How to validate zip code in java if the zip code pattern changes dynamically?

I need to validate the zip code in java. I have googled and there are many regular expressions. The problem …

java validation pattern-matching zipcode
What is the difference between unapply and unapplySeq?

Why does Scala have both unapply and unapplySeq? What is the difference between the two? When should I prefer one …

scala pattern-matching unapply
How exactly "case" works in partial functions in Scala?

I am just starting my seemingly steep learning curve with Scala and can't quite grasp how "case" works in partial …

scala pattern-matching partialfunction
Why time complexity of brute force algorithm is O(n*m)?

I am using the following brute force algorithm for searching a string inside another string. As I know, the number …

algorithm pattern-matching time-complexity brute-force string-search