/t5/indesign-discussions/regexp-for-thin-space/td-p/1108696Nov 11, 2008
Nov 11, 2008
Copy link to clipboard
Copied
Sorry to pester you with another newbie question. Try as I might, I
can't seem to hit on the right syntax to find thin spaces (for
example) in a string and replace them with nothing. I've tried every
conceivable combination of [], '' and \ with ~< but I still get
little boxes where the thin space was instead of nothing, and I
can't find any alternative to ~< for Thin Space.
myString = myString.replace(/~Will anyone point me in the right direction?
--
Noel
/t5/indesign-discussions/regexp-for-thin-space/m-p/1108697#M337044Nov 11, 2008
Nov 11, 2008
Copy link to clipboard
Copied
hi noel,
you're using the javascript string replace function. there you cant use the indesign shortcuts. you need the real thin space here (i haven't tested but i guess it will work with copy and paste) or check out the unicode representation and use it with \u.
i would recomend using the built in indesing grep search and replace. which is in short:
/t5/indesign-discussions/regexp-for-thin-space/m-p/1108699#M337046Nov 11, 2008
Nov 11, 2008
Copy link to clipboard
Copied
LATEST
I'm very grateful to you both. I'm manipulating strings to be used
outside of the document, so I have to use a script. The Unicode
solution works fine, of course. Can I assume that any regex I find
in the F&R GREP box that isn't in Gordon McKinney's quick reference
guide at
http://www.night-ray.com/regex.pdf
has to be treated specially?
--
Noel