tagged [regex]

RegEx Starts with [ and ending with ]

RegEx Starts with [ and ending with ] What is the Regular Expression to find the strings starting with [ and ending with ]. Between [ and] all kind of character are fine.

21 Feb at 13:27

C# Regular Expressions, string between single quotes

C# Regular Expressions, string between single quotes i want to get the text between `'` quotes using Regular Expressions. Can anyone?

14 Apr at 12:7

Regex for allowing alphanumeric,-,_ and space

Regex for allowing alphanumeric,-,_ and space I am searching for a regular expression for allowing alphanumeric characters, -, _ or spaces in JavaScript/jQuery. How can this be done?

21 Dec at 04:30

RegEx to extract all matches from string using RegExp.exec

RegEx to extract all matches from string using RegExp.exec I'm trying to parse the following kind of string: where there are arbitrary key:"val" pairs inside. I want to grab the key name and the value...

Find CRLF in Notepad++

Find CRLF in Notepad++ How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word.

11 Jun at 07:59

Regex for quoted string with escaping quotes

Regex for quoted string with escaping quotes How do I get the substring `" It's big \"problem "` using a regular expression?

30 Jan at 16:22

How do I remove all non alphanumeric characters from a string except dash?

How do I remove all non alphanumeric characters from a string except dash? How do I remove all non alphanumeric characters from a string except dash and space characters?

29 Sep at 21:30

Negative matching using grep (match lines that do not contain foo)

Negative matching using grep (match lines that do not contain foo) How do I match all lines not matching a particular pattern using `grep`? I tried this:

14 Aug at 23:56

What is the meaning of the 'g' flag in regular expressions?

What is the meaning of the 'g' flag in regular expressions? What is the meaning of the `g` flag in regular expressions? What is is the difference between `/.+/g` and `/.+/`?

29 Jun at 14:0

How to remove numbers from string using Regex.Replace?

How to remove numbers from string using Regex.Replace? I need to use `Regex.Replace` to remove all numbers and signs from a string. Example input: `123- abcd33` Example output: `abcd`

19 Mar at 08:55

AWK: Access captured group from line pattern

AWK: Access captured group from line pattern If I have an awk command and pattern uses a capturing group, how can I access the string so captured in the block?

29 Jun at 19:32

Asp.net jquery reqex conversion?

Asp.net jquery reqex conversion? Is there an easy way to do the equivalent in jquery or jscript for that matter.

3 Aug at 15:51

Regex to match string containing two names in any order

Regex to match string containing two names in any order I need logical AND in regex. something like jack AND james agree with following strings - 'hi here is '- 'hi here is '

9 Dec at 02:48

Named capturing groups in JavaScript regex?

Named capturing groups in JavaScript regex? As far as I know there is no such thing as named capturing groups in JavaScript. What is the alternative way to get similar functionality?

20 Mar at 08:2

Remove all special characters, punctuation and spaces from 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 numbers.

11 Jun at 04:20

Regex: ignore case sensitivity

Regex: ignore case sensitivity How can I make the following regex ignore case sensitivity? It should match all the correct characters but ignore whether they are lower or uppercase.

3 Aug at 16:7

Can I use regex expression in c# with switch case?

Can I use regex expression in c# with switch case? Can I write switch case in c# like this?

11 Oct at 03:51

Why doesn't [01-12] range work as expected?

Why doesn't [01-12] range work as expected? I'm trying to use the range pattern `[01-12]` in regex to match two digit mm, but this doesn't work as expected.

8 Jul at 05:36

Regex select all text between tags

Regex select all text between tags What is the best way to select all the text between 2 tags - ex: the text between all the '``' tags on the page.

22 Jun at 18:9

Regular Expression to get all characters before "-"

Regular Expression to get all characters before "-" How can I get the string before the character `"-"` using regular expressions? For example, I have `"text-1"` and I want to return `"text"`.

20 Sep at 14:15

How do I replace the *first instance* of a string in .NET?

How do I replace the *first instance* of a string in .NET? I want to replace the first occurrence in a given string. How can I accomplish this in .NET?

15 Sep at 21:21

Regex: match everything but a specific pattern

Regex: match everything but a specific pattern I need a regular expression able to match everything a string starting with a specific pattern (specifically `index.php` and what follows, like `index.ph...

23 Feb at 22:19

Regex to replace multiple spaces with a single space

Regex to replace multiple spaces with a single space Given a string like: What kind of jQuery or JavaScript magic can be used to keep spaces to only one space max? Goal:

3 May at 16:14

Return positions of a regex match() in Javascript?

Return positions of a regex match() in Javascript? Is there a way to retrieve the (starting) character positions inside a string of the results of a regex match() in Javascript?

C# Regex to validate phone number

C# Regex to validate phone number It would be great if someone could help me with a Regex for phone numbers. Following are the conditions: - - - - - Here are some valid numbers: - - - - - - - - Thanks...

18 Jan at 11:1