Top "Regex" questions

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

Grep regex NOT containing string

I am passing a list of regex patterns to grep to check against a syslog file. They are usually matching …

regex grep
How to "inverse match" with regex?

I'm using RegexBuddy but I'm in trouble anyway with this thing :\ I'm processing line by line a file. I built …

regex inverse-match
Regular expression matching a multiline block of text

I'm having a bit of trouble getting a Python regex to work when matching against text that spans multiple lines. …

python regex multiline
How do I get the YouTube video ID from a URL?

I want to get the v=id from YouTube’s URL with JavaScript (no jQuery, pure JavaScript). Example YouTube URL …

javascript regex url youtube
Best Regular Expression for Email Validation in C#

I have seen a multitude of regular expressions for different programming languages that all purport to validate email addresses. I …

c# regex email-validation
RegEx - Match Numbers of Variable Length

I'm trying to parse a document that has reference numbers littered throughout it. Text text text {4:2} more incredible text {4:3} much …

regex
Regex to get the words after matching string

Below is the content: Subject: Security ID: S-1-5-21-3368353891-1012177287-890106238-22451 Account Name: ChamaraKer Account Domain: JIC …

regex expression regex-negation regex-lookarounds
How to use regex in String.contains() method in Java

I want to check if a String contains the words "stores", "store", and "product" in that order, no matter what …

java regex string
Regex to match any character including new lines

Is there a regex to match "all characters including newlines"? For example, in the regex below, there is no output …

regex perl