Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

regexp \m \M

2 views
Skip to first unread message

Roy Terry

unread,
Mar 13, 2003, 3:50:51 PM3/13/03
to
Maybe it's just the pointed hat I'm
wearing, but it seems:

regexp {\m\$f\M} { $f }

should be a match.

Can someone explain why not?

Michael A. Cleverly

unread,
Mar 13, 2003, 4:08:06 PM3/13/03
to Roy Terry

Because \m and \M anchor at the beginning and end of a word, and a word is
defined as "a sequence of word characters that is neither preceded nor
followed by word characters. A word character is an alnum character or an
underscore (_)."

So, $ is not a "word", hence the expression does not match.

Michael

Roy Terry

unread,
Mar 13, 2003, 4:15:31 PM3/13/03
to

Do you have to make it sound so obvious? :*)

Doh! - and thanks

0 new messages