!! Version 2 !! test basic rmatch with successful match !! wikitext {{#rmatch:this is some page content|\bcontent$|it matched|did not match}} !! html
it matched
!! end !! test basic rmatch with failed match !! wikitext {{#rmatch:this is some page content|^not matching regex|it matched|did not match}} !! htmldid not match
!! end !! test successful rmatch with backreference !! wikitext {{#rmatch:this is some page content|^(.+)\s\bcontent$|it expands backreference: $1|did not match}} !! htmlit expands backreference: this is some page
!! end !! test successful rmatch with second backreference !! wikitext {{#rmatch:this is some page content|^(.+)\s\bsome\s(.+)\s\bcontent$|it expands backreference: $2|did not match}} !! htmlit expands backreference: page
!! end !! test successful rmatch with spurious capturing group !! wikitext {{#rmatch:this is some page content|^(.+)\s\bcontent$|this is a spurious backref: $52 will be removed|did not match}} !! htmlthis is a spurious backref: will be removed
!! end