Commit Graph

2 Commits

Author SHA1 Message Date
Pieter de Bie 3324591e6c Fix UTF-8 bug in NSString_RegEx
This class would use the location information provided by
regex(3) as range for for a substring. However, the information
regex(3) returns is a byte-based, while NSString works on characters.

This can cause a problem when there are UTF-8 characters in the string,
as the wrong subsstring will be returned.

This is fixed by taking the UTF bytesequence, and extracting a substring
from that, rather than using NSString's own substring method
2009-09-14 13:25:01 +02:00
Pieter de Bie e79c11b9a1 NSSTring_RegEx: Add support for regular expressions to NSString
This is an extension found via Cocoadev, created by John R Chang. Thanks!
2009-06-11 18:57:34 +01:00