Top "Regex" questions

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

How to validate an email address in PHP

I have this function to validate an email addresses: function validateEMAIL($EMAIL) { $v = "/[a-zA-Z0-9_-.+]+@[a-zA-Z0-9-]+.[a-zA-Z]+/"; …

php regex email email-validation
Using Regular Expressions to Extract a Value in Java

I have several strings in the rough form: [some text] [some number] [some more text] I want to extract the …

java regex
Escape string for use in Javascript regex

Possible Duplicate: Is there a RegExp.escape function in Javascript? I am trying to build a javascript regex based on …

javascript regex escaping
How to check for valid email address?

Is there a good way to check a form input using regex to make sure it is a proper style …

python regex email-validation email-address
Regular expression search replace in Sublime Text 2

I'm looking to do search replace with regular expressions in Sublime Text 2. The documentation on this is rather anemic. Specifically, …

regex replace sublimetext2
How can I match a string with a regex in Bash?

I am trying to write a bash script that contains a function so when given a .tar, .tar.bz2, .tar.…

regex string bash
Regex match one of two words

I have an input that can have only 2 values apple or banana. What regular expression can I use to ensure …

regex forms validation
How do I replace multiple spaces with a single space in C#?

How can I replace multiple spaces in a string with only one space in C#? Example: 1 2 3 4 5 would be: 1 2 3 4 5

c# regex string
How to replace a whole line with sed?

Suppose I have a file with lines aaa=bbb Now I would like to replace them with: aaa=xxx I …

regex sed
Regex how to match an optional character

I have a regex that I thought was working correctly until now. I need to match on an optional character. …

regex string operators