On Nov 19, 2015, at 09:22, Yvan KOENIG <email@hidden> wrote:
If I read well, the script replace non breaking spaces by standard ones but do that to all of them, even if some are included in strings used by an instruction.
______________________________________________________________________
Hey Yvan,
True.
But I don't often see anyone using NBSes in their code, and it's difficult to exclude quoted strings with embedded NBSes without making more than one pass.
If I continue to read well it seems that there is no code to replace curly quotes by straight ones although its something which appear very often. Of course, like the non-breaking spaces, we may have curly quotes embedded in strings which must remain unchanged.
Like NBSes I don't often see people using smart-quotes in their code.
I have another 'Zap-Gremlins' script I use if my script won't compile, although I might just add SQ's into the email-to-Script-Debugger script.
The cng handler is pretty straightforward, so you can make alterations as you like.
cng(<RegEx-FindStr>, <RegEx-ReplaceStr>, _text)
set myStr to "“Now is the ‘time’ for all good men to come to the aid of their country.”" set myStr to cng("[“”]", "\"", myStr) of me set myStr to cng("[‘’]", "'", myStr) of me
The default regex syntax for the Satimage.osax is Ruby.
|