Top "Regex-group" questions

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

Python Regex instantly replace groups

Is there any way to directly replace all groups using regex syntax? The normal way: re.match(r"(?:aaa)(_bbb)", …

python regex regex-group
Match list of words without the list of chars around

I have this regex (?:$|^| )(one|common|word|or|another)(?:$|^| ) which matches fine unless the two words are next to each …

regex pattern-matching regex-group
extract substring using regex in groovy

If I have the following pattern in some text: def articleContent = "<![CDATA[ Hellow World ]]>" I would like to …

regex groovy regex-group
How can I store captures from a Perl regular expression into separate variables?

I have a regex: /abc(def)ghi(jkl)mno(pqr)/igs How would I capture the results of each parentheses …

arrays regex perl regex-group
preg_replace how to replace only matching xxx($1)yyy pattern inside the selector

I'm trying to use a regular expression to erase only the matching part of an string. I'm using the preg_…

php regex replace preg-match regex-group
Powershell - Regular Expression Multiple Matches

Maybe my reasoning is faulty, but I can't get this working. Here's my regex: (Device\s#\d(\n.*)*?(?=\n\s*…

regex powershell powershell-4.0 regex-group
How do I write a regular expression that excludes rather than matches, e.g., not (this|string)?

I am stumped trying to create an Emacs regular-expression that excludes groups. [^] excludes individual characters in a set, but I …

regex emacs elisp regex-negation regex-group
Regular Expression in sed for multiple replacements in one statement

I want to sanitise some input and replace several characters with acceptable input, e.g. a Danish 'å' with …

regex sed sublimetext2 regex-group
Regex and the OR operator without grouping in Python?

Here are the cases. I'm looking for the following pattern in a log file. All strings are in the form …

python regex regex-group
scala regex group matching and replace

val REGEX_OPEN_CURLY_BRACE = """\{""".r val REGEX_CLOSED_CURLY_BRACE = """\}""".r val REGEX_INLINE_DOUBLE_QUOTES = """\\\"""".r val REGEX_…

regex scala replace regex-group