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

RegExp in TypeScript

RegExp in TypeScript How can I implement RegExp in TypeScript? My example:

4 Aug at 02:10

Regex to match alphanumeric and spaces

Regex to match alphanumeric and spaces What am I doing wrong here?

8 Oct at 04:35

PHP String Parsing

PHP String Parsing I have string which contains something about `"amount 3 val 6, amount 7 val 8"` and so, what regular expression should I use to get array with corresponding amounts and values?

21 Jan at 17:21

How to remove extra returns and spaces in a string by regex?

How to remove extra returns and spaces in a string by regex? I convert a HTML code to plain text.But there are many extra returns and spaces.How to remove them?

11 Feb at 20:7

Regex: Remove lines containing "help", etc

Regex: Remove lines containing "help", etc I have a long document of commands. Using Notepad++ or regex, I want to delete all lines containing "help" including keyboard_help, etc. How can this be done...

29 Jun at 20:44

C# - Regex for file paths e.g. C:\test\test.exe

C# - Regex for file paths e.g. C:\test\test.exe I am currently looking for a regex that can help validate a file path e.g.:

20 Jun at 19:2

Learning Regular Expressions

Learning Regular Expressions I don't really understand regular expressions. Can you explain them to me in an easy-to-follow manner? If there are any online tools or books, could you also link to them?

7 Jan at 14:39

Regex to check if valid URL that ends in .jpg, .png, or .gif

Regex to check if valid URL that ends in .jpg, .png, or .gif I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif.

2 Mar at 03:13

RegEx: Grabbing values between quotation marks

RegEx: Grabbing values between quotation marks I have a value like this: What regex will return the values enclosed in the quotation marks (e.g. `Foo Bar` and `Another Value`)?

15 Mar at 17:32

Which one is a more reliable matching scheme, EREGI or STRIPOS?

Which one is a more reliable matching scheme, EREGI or STRIPOS? Which scheme according to you is a better one in case of matching? Is it eregi or stripos or any other method?

24 Mar at 12:38

Using C# regular expressions to remove HTML tags

Using C# regular expressions to remove HTML tags How do I use C# regular expression to replace/remove all HTML tags, including the angle brackets? Can someone please help me with the code?

25 Apr at 03:12

regex to match a single character that is anything but a space

regex to match a single character that is anything but a space I need to match a single character that is anything but a space but I don't know how to do that with regex.

25 Jul at 05:37

Explode string by one or more spaces or tabs

Explode string by one or more spaces or tabs How can I explode a string by one or more spaces or tabs? Example: I want to make this an array.

24 Nov at 21:17

Regex Query Builder

Regex Query Builder I am a C# developer, I have been looking at regular expressions (regex) and wanted to know if anyone knows about useful tools for building regular expressions - like a regex query ...

2 Jan at 10:59

how to remove char (") from the begin and the end of a string?

how to remove char (") from the begin and the end of a string? how to remove char (") from the begin and the end of a string ? ex: `"1234"567" ==> 1234"567` thank's in advance

14 Apr at 18:18

Regex: Match any punctuation character except . and _

Regex: Match any punctuation character except . and _ Is there an easy way to match all punctuation except period and underscore, in a C# regex? Hoping to do it without enumerating every single punctu...

19 Oct at 23:44

Regex remove special characters

Regex remove special characters We need a C# function which will remove all special characters from a string. Also, is it possible to change "George's" to "George" (remove both single quote and charac...

12 Feb at 08:27

I want to remove double quotes from a String

I want to remove double quotes from a String I want to remove the `""` around a String. e.g. if the String is: `"I am here"` then I want to output only `I am here`.

30 Dec at 14:21

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

How do I match any character across multiple lines in a regular expression? For example, this regex will match: But how do I get it to match across multiple lines?

19 Apr at 20:59

C# code to linkify urls in a string

C# code to linkify urls in a string Does anyone have any good c# code (and regular expressions) that will parse a string and "linkify" any urls that may be in the string?

17 Feb at 05:43

What does the regex \S mean in JavaScript?

What does the regex \S mean in JavaScript? What does /\S/ mean in a regex?

7 Feb at 18:28

How to remove a defined part of a string?

How to remove a defined part of a string? I have this string: "NT-DOM-NV\MTA" How can I delete the first part: "NT-DOM-NV" To have this as result: "MTA"

28 Dec at 10:1

Negative regex for Perl string pattern match

Negative regex for Perl string pattern match I have this regex: I want to match with Clinton and Reagan, but not Bush. It's not working.

12 Aug at 14:9

Regex match one of two words

Regex match one of two words I have an input that can have only 2 values `apple` or `banana`. What regular expression can I use to ensure that either of the two words was submitted?

28 Jul at 18:0

How can I add a string to the end of each line in Vim?

How can I add a string to the end of each line in Vim? I want to add `*` to the end of each line in Vim. I tried the code unsuccessfully

20 May at 14:59