Regular Expressions 101

Community Patterns

Replace second grouping with first

1

Regular Expression
PCRE (PHP <7.3)

/
(id='.*?') (srcDocId='.*?')
/
gi

Description

Identifies two groups, each group using a regex, then replaces group 2 with group 1.

Submitted by Stuart Shannon - 9 years ago