[wplug] simple regex
Brian Medley
bpm-list-wplug at 4321.tv
Wed Jun 25 19:58:47 EDT 2003
On Wed, Jun 25, 2003 at 07:50:25PM -0400, James O'Kane wrote:
> > In your expression the ^ is interpreted as the beginning of the line.
> > It's not <NOT> as I think you were trying.
>
> The question is, why not? From the grep man page:
>
> A bracket expression is a list of characters enclosed by [ and ]. It
> matches any single character in that list; if the first character of the
> list is the caret ^ then it matches any character not in the list. For
> example, the regular expression [0123456789] matches any single digit.
Seems like you said it. The ^ makes it match any character not in the
list. That means it will match every line where there is a character that
is not an '@'.
$ echo "@@@@@" | grep '[^@]'
$ echo "@@@@@a" | grep '[^@]'
@@@@@a
--
~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/ (___) \|/ _,.-=~'`^`
Brian Medley @~./'O o`\.~@
"Knowledge is Power" brian.medley at verizon.net /__( \___/ )__\ *PPPFFBT!*
-- Francis Bacon `\__`U_/'
_,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|' ^^`'~=-.,__,.-=
~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`
More information about the wplug
mailing list