any idea why this: %20AND%20foo%3A%22(.+?)%22
won't match this: %20AND%20foo%3A%22some random string of characters%22
in the Twig |replace
filter?
If i do this:
{% set foo = '%20AND%20foo%3A%22some random string of characters%22' %}
{% set bar = '%20AND%20foo%3A%22(.+?)%22' %}
{{ foo |replace(bar, 'replaced') }}
{# OR THIS #}
{{ foo |replace((bar), 'replaced') }}
The result is foo
. Nothing gets replaced. I'd expect the result to be the string "replaced". What am I doing wrong?