[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Patterns: Why are anchors not character classes?
- From: Rena <hyperhacker@...>
- Date: Sat, 18 Jul 2015 18:43:50 -0400
On Sat, Jul 18, 2015 at 3:26 PM, Tom N Harris <firstname.lastname@example.org> wrote:
> On Saturday, July 18, 2015 02:45:18 PM Rena wrote:
>> Well, regardless of whether it's classified as a character class or a set
>> or a special case or a fruit or a vegetable, I've many times wished I could
>> write a pattern such as "[ ^]%w+[ $]" (match one or more word characters
>> bounded by either a space or the start/end of a string). Though ^ already
>> has a meaning there...
> No regex-like implementation I know of works like that, though. I'd write "(^|
> )%w+($| )". Lua doesn't have the alternation operator however. Is that what's
> really being asked for? But disguised as a discussion about character classes.
> tom <email@example.com>
Alternation would be great, but I think it's been discussed before and
it would add too much complexity to the implementation.
Sent from my Game Boy.