[Date Prev][Date Next][Thread Prev][Thread Next]
- 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 <email@example.com>:
> 2015-07-14 18:21 GMT+02:00 John Hind <firstname.lastname@example.org>:
>> If the start and end anchors behaved like character classes we could do
> 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.