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
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.
The text was updated successfully, but these errors were encountered:
Given the following CSS:
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") :
But if I remove the trailing space, then the replacement works correctly:
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.The text was updated successfully, but these errors were encountered: