Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
<{7}[ ]HEAD[\r\n]{1,2}([\S\s]*?)(?:={7}[\r\n]{1,2}((?:[\S\s]?(?!(>{7}[ ][a-z0-9]{40})))*[\r\n]?)(?:>{7}[ ][a-z0-9]{40}[\r\n]{0,2})?)
/
x

Description

Group 1 gives ours, group 2 gives theirs

Submitted by Erik - 9 years ago