Regex to remove trailing slash not working I am trying to remove the http:// and trailing slash from a string, so my replace filter looks like this:

website|replace({ 'http://': '', '/\\/$/': '' })

The http:// part works, the trailing slash one doesn't. Why not?
I think you are getting the twig replace filter (which does not have the regex capability) instead of the Craft replace filter (which does).

So this is a bug in Craft, in that their filter is masked by the twig one.

You could use the trim filter to remove trailing /s:

website|replace({'http://':''})|trim('/')


Or you could use one of Victor's Twig PCRE Filters.