Ted Zlatanov <[email protected]> writes:

> CW> I only have one problem. At the moment I need to use:
> CW>     "^nl\\.\\|\\.nl\\.\\|\\.nl$" 
> CW> for the regular expression. I would prefer to use something like:
> CW>     "[\\.^]nl[\\.$]"
>
> CW> But that does not work. Is there another way to make the regular
> CW> expression simpler?
> If the '.' character is not in your word class (it shouldn't be), you
> can use
>
> (string-match "\\bnl\\b" "X.nl.X")

This also matches:
    (string-match "\\bnl\\b" "X-nl-X")

But I do not think that is a problem. So I now use "\\bnl\\b". That is a
lot clearer as "^nl\\.\\|\\.nl\\.\\|\\.nl$" and easier to adopt when
another language has to be added.

Thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to