Top "Regex" questions

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

Regular expression to match balanced parentheses

I need a regular expression to select all the text between two outer brackets. Example: some text(text here(possible …

regex
Regex match everything after question mark?

I have a feed in Yahoo Pipes and want to match everything after a question mark. So far I've figured …

regex
JavaScript Regular Expression Email Validation

This code is always alerting out "null", which means that the string does not match the expression. var pattern = "^\w+@[…

javascript regex
Check if a string matches a regex in Bash script

One of the arguments that my script receives is a date in the following format: yyyymmdd. I want to check …

regex bash shell scripting
Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces

Looking for quick, simple way in Java to change this string " hello there " to something that looks like this "hello …

java regex string replace
PHP string "contains"

What would be the most efficient way to check whether a string contains a "." or not? I know you can …

php regex string
Regex not operator

Is there an NOT operator in Regexes? Like in that string : "(2001) (asdf) (dasd1123_asd 21.01.2011 zqge)(dzqge) name (20019)" I want to …

java regex string
How to input a regex in string.replace?

I need some help on declaring a regex. My inputs are like the following: this is a paragraph with<[1&…

python regex string replace
Regular expression to match DNS hostname or IP Address?

Does anyone have a regular expression handy that will match any legal DNS hostname or IP address? It's easy to …

regex dns
Check if a String contains numbers Java

I'm writing a program where the user enters a String in the following format: "What is the square of 10?" I …

java regex string