On Fri, 25 Dec 2009 11:08:27 +0100 Cecil Westerhof <[email protected]> wrote:
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? The simplest solution is probably to use split-string, since you'll get all the path components that way: (member "nl" (split-string "X.nl.X" "\\.")) Your regex character class of [\\.^] doesn't work because it's matching the character ^ and not the beginning of the line. Same for the [\\.$] class. If the '.' character is not in your word class (it shouldn't be), you can use (string-match "\\bnl\\b" "X.nl.X") which is probably the best regex-based solution, so it will work with your existing code. You could also use \< and \> but that's probably unnecessary. Look at the ELisp manual, section "Backslash Constructs in Regular Expressions" for details. Ted _______________________________________________ info-gnus-english mailing list [email protected] http://lists.gnu.org/mailman/listinfo/info-gnus-english
