Regex \s doesn't match zero width space Topic is solved

Report problems with documented functionality
eugenesv
Posts: 175
Joined: 21 Dec 2015, 10:11

Regex \s doesn't match zero width space

03 Sep 2023, 11:37

this fails (there is a space in the first string u200B though maybe the paste/forum ate it)

Code: Select all

msgbox(RegExReplace('​','\s','1')='1')
Descolada
Posts: 1141
Joined: 23 Dec 2021, 02:30

Re: Regex \s doesn't match zero width space  Topic is solved

03 Sep 2023, 13:06

Usually \s is defined to match a space, tab, newline, carriage return, or vertical tab. Zero-width space is not among those. Testing in regex101.com \s also doesn't match it, whereas \p{Cf} does. Why do you think it should match it?
eugenesv
Posts: 175
Joined: 21 Dec 2015, 10:11

Re: Regex \s doesn't match zero width space

03 Sep 2023, 15:33

I thought it should match since it's called a space :)

But you're right, it's not even defined as whitespace propertied char in Unicode, so not really an AHK bug, just a Unicode complexity, sorry about the false alarm, will use the more extensive matching rules

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 122 guests