Re: Patterns: Why are anchors not character classes?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2015年7月16日 13:37:50 +0200
2015年07月16日 12:16 GMT+02:00 Dirk Laurie <dirk.laurie@gmail.com>:
> 2015年07月14日 18:21 GMT+02:00 John Hind <john.hind@zen.co.uk>:
>> If the start and end anchors behaved like character classes we could do
>> better.
> These represent an empty string at respectively the beginning or the end
> of the subject. ... The proposal ... does not seem terribly hard to implement.
> We could get some hands-on experience on them instead of making the
> capital mistake of theorizing without data. Power patch, anyone?
Taking up my own challenge, I discovered that it is much trickier than
I thought. `[set]` is hardcoded to match one character of the subject or
to report no match. So matching an empty string at the beginning or
end of the subject requires a redesign of more than just the function
`matchbracketclass`. That's out of my league.