You are not logged in.

#1 13 Jan 2016 10:25

mkesper
New Member
Registered: 13 Jan 2016
Posts: 1

Toggling i18n-awareness of PowerShell regex

At SS64 syntax-regex.html it is stated that \w is equivalent to [a-zA-Z_0-9].
This is not exact.

'müller-riebensehl' -match '^[\w-]+?$'
True

Is there any way to reliably only match on ASCII characters, not on umlauts etc. without making it explicit?

^[a-zA-Z0-9-]+?$

Offline

#2 14 Jan 2016 01:43

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Toggling i18n-awareness of PowerShell regex

I don't think there is, but I have updated the page with some notes about it matching foreign language letters with accents.

I'd like to see a regex switch that could compare a string to the users current language and flag any characters which don't match that language.

Offline

Board footer

Powered by