Top "Regex-group" questions

Regex groups are created by placing part of a regular expression inside parentheses.

What is a non-capturing group in regular expressions?

How are non-capturing groups, i.e. (?:), used in regular expressions and what are they good for?

regex capturing-group regex-group
RegEx to extract all matches from string using RegExp.exec

I'm trying to parse the following kind of string: [key:"val" key2:"val2"] where there are arbitrary key:"val" pairs …

javascript regex regex-group taskwarrior
RegEx for matching UK Postcodes

I'm after a regex that will validate a full complex UK postcode only within an input string. All of the …

regex validation regex-group postal-code
Named regular expression group "(?P<group_name>regexp)": what does "P" stand for?

In Python, the (?P<group_name>…) syntax allows one to refer to the matched string through its name: &…

python regex regex-group
Can I replace groups in Java regex?

I have this code, and I want to know, if I can replace only groups (not all pattern) in Java …

java regex replace regex-group
How to capture multiple repeated groups?

I need to capture multiple groups of the same pattern. Suppose, I have a following string: HELLO,THERE,WORLD And …

regex swift nsregularexpression regex-greedy regex-group
Can I use an OR in regex without capturing what's enclosed?

I'm using rubular.com to build my regex, and their documentation describes the following: (...) Capture everything enclosed (a|b) a …

regex capture regex-group
Vim Regex Capture Groups [bau -> byau : ceu -> cyeu]

I have a list of words: bau ceu diu fou gau I want to turn that list into: byau cyeu …

regex vim capturing-group regex-group
Regex optional group

I am using this regex: ((?:[a-z][a-z]+))_(\d+)_((?:[a-z][a-z]+)\d+)_(\d{13}) to match strings like this: SH_6208069141055_BC000388_20110412101855 separating …

regex optional regex-group
python re.sub group: number after \number

How can I replace foobar with foo123bar? This doesn't work: >>> re.sub(r'(foo)', r'\1123…

python regex numbers regex-group