Top "Regex" questions

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

How to remove all line breaks from a string

I have a text in a textarea and I read it out using the .value attribute. Now I would like …

javascript regex string
Regular Expressions- Match Anything

How do I make an expression to match absolutely anything (including whitespaces)? Example: Regex: I bought _____ sheep. Matches: I bought …

regex
Regular expression for exact match of a string

I want to match two passwords with regular expression. For example I have two inputs "123456" and "1234567" then the result should …

regex
Replace specific characters within strings

I would like to remove specific characters from strings within a vector, similar to the Find and Replace feature in …

r regex replace gsub string-substitution
Find CRLF in Notepad++

How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p …

regex notepad++
Check if string matches pattern

How do I check if a string matches this pattern? Uppercase letter, number(s), uppercase letter, number(s)... Example, These …

python regex string-matching
Regex: matching up to the first occurrence of a character

I am looking for a pattern that matches everything until the first occurrence of a specific character, say a ";" - …

regex
Find and extract a number from a string

I have a requirement to find and extract a number contained within a string. For example, from these strings: string …

c# .net regex string
Remove all special characters, punctuation and spaces from string

I need to remove all special characters, punctuation and spaces from a string so that I only have letters and …

python regex string
How do I split a string with multiple separators in javascript?

How do I split a string with multiple separators in JavaScript? I'm trying to split on both commas and spaces …

javascript regex split