You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Pattern doesn't match with trailing whitespace #309
If I include a trailing space at the end of my regular expression pattern, postcss-replace will not perform the replacement. For example, this postcss-replace config does not work (note the space character after the word "body") :
// This does not work
postcssReplace({
pattern: /body /g,
data: { replaceAll: "BLAH " }
}),
But if I remove the trailing space, then the replacement works correctly:
// This works correctly
postcssReplace({
pattern: /body/g,
data: { replaceAll: "BLAH" }
}),
Any idea what's happening here? According to this test on RegExr, a trailing space should correctly match in this scenario. I've tried using \s to match any whitespace character and that does not work either. Something odd seems to be going on with whitespace at the end of the regular expression pattern.
Activity