Just trying to use Craft's Twig replace filter to remove number prefixes from the beginning of User Groups names and I have had to double escape the character classes etc to get it to work. I tried this...
{{ group.name|replace('/^\d+\.\s/','') }}{% if not loop.last %}, {% endif %}
and it didn't work so for some reason I tried this...
{{ group.name|replace('/^\\d+\\.\\s/','') }}{% if not loop.last %}, {% endif %}
...and it worked. Is there a sensible explanation for this as Regular Expressions are like Voodoo?!
matches
operator, which was also wrong in Sensiolabs' docs.