Questions tagged [match]

A programming concept about finding results based on some kind of search. Typically used when talking about regular expressions.

A programming concept about finding results based on some kind of search. Typically used when talking about regular expressions.

See also , ,

8645 questions
98
votes
5 answers

Count number of occurrences of a pattern in a file (even on same line)

When searching for number of occurrences of a string in a file, I generally use: grep pattern file | wc -l However, this only finds one occurrence per line, because of the way grep works. How can I search for the number of times a string appears in…
jrdioko
  • 32,230
  • 28
  • 81
  • 120
97
votes
6 answers

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 a regex with options i. But I am having trouble restricting the regex to just that word, it performs more like a 'Like'…
Praneeta
  • 1,554
  • 3
  • 19
  • 20
95
votes
10 answers

How to match an empty dictionary in Javascript?

From the node REPL thing, > d = {} {} > d === {} false > d == {} false Given I have an empty dictionary, how do I make sure it is an empty dictionary ?
João Pinto Jerónimo
  • 9,586
  • 15
  • 62
  • 86
79
votes
2 answers

Jquery Value match Regex

I am trying to validate the input for E-Mail via JQuery: My JQuery