I’ve just been modifying a Lua pattern to try to get it to match " " but not “\n”. Unfortunately the %s character class matches both, and I wanted something more elegant than sticking a space in the pattern itself.
My current solution has been the rather inelegant [^%c%d%a] pattern (i.e. not a control character and not a digit and not a letter).
Anyone know of any better solutions? The test case is:
Sticking a space in it is less “elegant” than using [^%c%d%a]?
You should just do this:
[lua]
local whiteSpacePattern = “[\t]”
[/lua]
If you’re having trouble with the “elegance” of that pattern, just imagine some dignified upper-class Victorian English woman with a pince-nez looking at you every time you see it.
Sticking a space in it is less “elegant” than using [^%c%d%a]?
You should just do this:
[lua]
local whiteSpacePattern = “[\t]”
[/lua]
If you’re having trouble with the “elegance” of that pattern, just imagine some dignified upper-class Victorian English woman with a pince-nez looking at you every time you see it.