Accessing the underlying matched NSRange for use with NSAttributedString has come up in both #26 and #37.
At this point I still consider the Foundation types implementation details. There are gotchas related the use of UTF-16, and I'd prefer to err on the side of safety where it's not possible to make that kind of mistake.
There are probably two main considerations stopping me from adding NSAttributedString support at the moment:
- So far I've endeavoured to only expose types in the standard library in the public API.
NSAttributedString isn't bridged, so I've avoided supporting it. If there was a first-class attributed string value type in the standard library, I think I'd be willing to support it.
At this point I'm still interested in reserving the right to replace the regular expression engine with something else, like PCRE.
In a world where Foundation is fully supported and cross-platform (and NSRegularExpression is implemented—it wasn't last time I checked), these reasons will start to hold less water.
Update: Moving away from NSRegularExpression at this stage is unlikely. So the main issue here seems like an API design one.
Accessing the underlying matched
NSRangefor use withNSAttributedStringhas come up in both #26 and #37.At this point I still consider the Foundation types implementation details. There are gotchas related the use of UTF-16, and I'd prefer to err on the side of safety where it's not possible to make that kind of mistake.
There are probably two main considerations stopping me from adding
NSAttributedStringsupport at the moment:NSAttributedStringisn't bridged, so I've avoided supporting it. If there was a first-class attributed string value type in the standard library, I think I'd be willing to support it.At this point I'm still interested in reserving the right to replace the regular expression engine with something else, like PCRE.In a world where Foundation is fully supported and cross-platform (andNSRegularExpressionis implemented—it wasn't last time I checked), these reasons will start to hold less water.Update: Moving away from
NSRegularExpressionat this stage is unlikely. So the main issue here seems like an API design one.