Page 1 of 1

Regular Expression literal starting with equals sign

Posted: Wed May 10, 2017 6:35 pm
by sheetjs

Code: Select all

/=+$/
Regular expressions literals starting with an equal sign are sometimes interpreted as the div-assignment operator.

One such fix, used in Base64.js, wraps the equal sign in a character class:

Code: Select all

/[=]+$/

Re: Regular Expression literal starting with equals sign

Posted: Mon Jul 24, 2017 9:23 pm
by xbytor
Nice find. I hate having to work around RegExp bugs.