Top "Regex" questions

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

How to match "anything up until this sequence of characters" in a regular expression?

Take this regular expression: /^[^abc]/. This will match any single character at the beginning of a string, except a, b, …

regex
How to extract a substring using regex

I have a string that has two single quotes in it, the ' character. In between the single quotes is …

java regex string text-extraction
How is the AND/OR operator represented as in Regular Expressions?

I'm currently programming a vocabulary algorithm that checks if a user has typed in the word correctly. I have the …

regex operators
Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters

I want a regular expression to check that: A password contains at least eight characters, including at least one number …

javascript asp.net regex
Regular expression to stop at first match

My regex pattern looks something like <xxxx location="file path/level1/level2" xxxx some="xxx"> I am only …

regex
Simple regular expression for a decimal with a precision of 2

What is the regular expression for a decimal with a precision of 2? Valid examples: 123.12 2 56754 92929292929292.12 0.21 3.1 Invalid examples: 12.1232 2.23332 e666.76 The decimal point …

regex
Regex to validate date format dd/mm/yyyy

I need to validate a date string for the format dd/mm/yyyy with a regular expresssion. This regex validates …

regex
How do I match any character across multiple lines in a regular expression?

For example, this regex (.*)<FooBar> will match: abcde<FooBar> But how do I get it to …

regex multiline
A regular expression to exclude a word/string

I have a regular expression as follows: ^/[a-z0-9]+$ This matches strings such as /hello or /hello123. However, I would …

regex
Regular expression to extract text between square brackets

Simple regex question. I have a string on the following format: this is a [sample] string with [some] special words. […

regex