.net - Why can't I match POSIX Character Classes -


the following snippet prints false:

console.writeline(regex.ismatch("abc", @"[[:alpha:]]")); 

but prints true:

console.writeline(regex.ismatch("abc", @"[a-za-z]")); 

why? shouldn't equivalent?

.net regexes don't support posix character classes. support unicode groups.

this work:

regex.ismatch("abc", @"^\p{l}+$");

the \p{l} group matches unicode letters.

see here more information:

http://msdn.microsoft.com/en-us/library/20bw873z.aspx#categoryorblock


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -