Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
any regex pros here?
#7
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,
Reply


Messages In This Thread
any regex pros here? - by wolfcry911 - 10-17-2008, 09:11 PM
Re: any regex pros here? - by TheCaber - 10-17-2008, 09:52 PM
Re: any regex pros here? - by wolfcry911 - 10-17-2008, 09:59 PM
Re: any regex pros here? - by Seacrest - 10-17-2008, 09:59 PM
Re: any regex pros here? - by wolfcry911 - 10-17-2008, 10:06 PM
Re: any regex pros here? - by wolfcry911 - 10-18-2008, 12:23 AM
Re: any regex pros here? - by TheCaber - 10-18-2008, 01:41 AM
Re: any regex pros here? - by TheCaber - 10-18-2008, 02:13 AM
Re: any regex pros here? - by wolfcry911 - 10-18-2008, 01:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)