Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Matching beginning and end of word
On Oct 8, 10:23am, Peter Stephenson wrote:
}
} We do have the special chracter range [[:WORD:]]. So I think you need
} to check both possibilities, using the (#s) for start (or (#e) for end)
} that Bart pointed out yesterday.
The problem is that [^[:WORD:]] matches one character, whereas \< \>
match an empty string in between two characters. It's difficult if
not impossible construct a generic pattern for that. Whether you can
achieve the desired effect depends on the context; Peter's answer is
fine if you're simply comparing, but if an s/// repacement is desired
you have to be more careful.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author