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.

Regular Expression to match 3 or more Consecutive Sequential Characters and Consecutive Identical Characters

I need regular expressions to match the below cases. 3 or more consecutive sequential characters/numbers; e.g. 123, abc, 789, pqr, etc. 3 …

java regex pattern-matching
PostgreSQL LIKE query performance variations

I have been seeing quite a large variation in response times regarding LIKE queries to a particular table in my …

postgresql indexing pattern-matching query-optimization sql-like
Ant path style patterns

What are the rules for Ant path style patterns. The Ant site itself is surprisingly uninformative.

java path ant pattern-matching
How to check if a word is present in a sentence using Java?

I am new to programming and working on a function to return true if a word is present in a …

java pattern-matching
Match list of words without the list of chars around

I have this regex (?:$|^| )(one|common|word|or|another)(?:$|^| ) which matches fine unless the two words are next to each …

regex pattern-matching regex-group
Using comparison operators in Scala's pattern matching system

Is it possible to match on a comparison using the pattern matching system in Scala? For example: a match { case 10 =&…

scala pattern-matching
Case insensitive search in Mongo

I am using a case insensitive search in Mongo, something similar to https://stackoverflow.com/q/5500823/1028488. ie I am using …

regex mongodb pattern-matching match case-insensitive
LOWER LIKE vs iLIKE

How does the performance of the following two query components compare? LOWER LIKE ... LOWER(description) LIKE '%abcde%' ... iLIKE ... …

performance postgresql pattern-matching database-performance
Display only the n'th match of grep

onefish onechicken twofish twochicken twocows threechicken What if I want to grep for lines containing "two", but I only want …

bash grep pattern-matching match
What is the difference between "x is null" and "x == null"?

In C# 7, we can use if (x is null) return; instead of if (x == null) return; Are there any advantages …

c# .net null pattern-matching c#-7.0