Top "Regex" questions

Regular expressions provide a declarative language to match patterns within strings.

Match two strings in one line with grep

I am trying to use grep to match lines that contain two different strings. I have tried the following but …

regex linux string grep
RegEx: Grabbing values between quotation marks

I have a value like this: "Foo Bar" "Another Value" something else What regex will return the values enclosed in …

regex
Regular expression to match standard 10 digit phone number

I want to write a regular expression for a standard US type phone number that supports the following formats: ###-###…

regex
What regex will match every character except comma ',' or semi-colon ';'?

Is it possible to define a regex which will match every character except a certain defined character or set of …

regex
Use String.split() with multiple delimiters

I need to split a string base on delimiter - and .. Below are my desired output. AA.BB-CC-DD.zip -&…

java regex
How do I remove all non alphanumeric characters from a string except dash?

How do I remove all non alphanumeric characters from a string except dash and space characters?

c# regex
Match linebreaks - \n or \r\n?

While writing this answer, I had to match exclusively on linebreaks instead of using the s-flag (dotall - dot matches …

regex language-agnostic line-breaks
How to escape regular expression special characters using javascript?

I need to escape the regular expression special characters using java script.How can i achieve this?Any help should …

javascript regex
Regular Expression to get a string between parentheses in Javascript

I am trying to write a regular expression which returns a string which is between parentheses. For example: I want …

javascript regex string
How can I write a regex which matches non greedy?

I need help about regular expression matching with non-greedy option. The match pattern is: <img\s.*> The text …

regex regex-greedy non-greedy