Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
\s*(?!#)(?:.*run\s)?(\bride\b).*?(\bmount\b|\bdismount\b)
/
gi

Description

finds every command in 1st group and subcommands in 2nd group. excludes every comments, and matches command even if it has spaces in the beginning. This exact regex is used for datapackhub.net datapack mcfunction downgrader.

Submitted by anonymous - a year ago