10-18-2008, 01:41 AM
Um, you never specified which language you were using to code the regular expressions. I gave the 'old school' UNIX/POSIX sed (stream editor) BRE (basic regular expressions) form.
Your latest post is clearly 'new school'. According to http://www.greenend.org.uk/rjk/2002/06/regexp.html , it is one of Perl, Python or Tcl, since it involves negated 'lookahead'. I'll guess it is Perl.
\b (match boundary at beginning of word)
\w+ (match one or more word-class characters (alphanumeric or underscore))
( ? ! : ) (next character is not a colon) (I embedded spaces to hold off the smilies)
\b (match boundary at end of word)
I think this will not eat the second colon, nor will it deal with embedded spaces or other non-word-class characters.
FWIW,
Your latest post is clearly 'new school'. According to http://www.greenend.org.uk/rjk/2002/06/regexp.html , it is one of Perl, Python or Tcl, since it involves negated 'lookahead'. I'll guess it is Perl.
\b (match boundary at beginning of word)
\w+ (match one or more word-class characters (alphanumeric or underscore))
( ? ! : ) (next character is not a colon) (I embedded spaces to hold off the smilies)
\b (match boundary at end of word)
I think this will not eat the second colon, nor will it deal with embedded spaces or other non-word-class characters.
FWIW,