[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: Thu, 16 Jul 2015 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.