i-hate-regex icon indicating copy to clipboard operation
i-hate-regex copied to clipboard

Aren't the `\b` in the UUID regex superfluous?

Open guillaumealgis opened this issue 2 years ago β€’ 2 comments

I'm not convinced the \b in the UUID regex serve any purpose. Why are we trying to match word boundaries here?

^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$

(I tested the regex without the \b and the same strings match or don't match)

@alex-hofmann do you remember why you added those?

guillaumealgis avatar Mar 14 '22 15:03 guillaumealgis

@guillaumealgis apologies for seeing this [not quite] a year since you asked. There's no reason for them, that I can remember, and with fresh eyes I would not include them.

It looks like the \b's are still out there, so one of us can likely PR an edit

alex-hofmann avatar Mar 08 '23 22:03 alex-hofmann

@alex-hofmann no worries ☺️

I won't bother with a PR, the repo hasn't seen activity since sept 2021 :)

guillaumealgis avatar Mar 13 '23 12:03 guillaumealgis