lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

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 <>