Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Yet another Regexp question
August 23, 2006, 5:16 pm
rate this thread
The problem is, I don't want to match it if the only thing in between
the underscores are spaces or other underscores:
_ _ _
(this should get no match)
(this should match "hello world" even though there's a space because
there's also things besides a space and underscore)
Right now, I've got this:
/_([^_]+?)_/ which does well at excluding _
I've also tried this:
/_([^_\s]+?)_/ which does well if there are NO spaces between the _'s.
(correctly matches "hello")
(does not match "hello world" as I would like)
_ _ _
(correctly does not match this)
I'm stumped. Any help?