Regular Expression literal starting with equals sign

Discussion of actual or possible Photoshop Scripting Bugs, Anomalies and Documentation Errors

Moderators: Tom, Kukurykus

sheetjs
Posts: 1
Joined: Wed May 10, 2017 6:26 pm

Regular Expression literal starting with equals sign

Post 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

/[=]+$/
xbytor
Posts: 22
Joined: Thu Jan 01, 1970 12:00 am

Re: Regular Expression literal starting with equals sign

Post by xbytor »

Nice find. I hate having to work around RegExp bugs.