in reply to Re: Regex puzzle for you
in thread Regex puzzle for you
But this is not equivalent, as it requires at least 2 characters in the parens, whereas my original/\b_+(\w+[^_])_+\b/
only requires 1./\b_+(\w+)_+\b/
In fact, reconsidering the original problem, I should have done something more like/\b_+(\w*[^_])_+\b/
because I want at least one [a-zA-Z] (although that too fails for "__x__"). Through sheer laziness, I've decided on:/\b_+([a-zA-Z]\w*[a-zA-Z0-9])_+\b/
even though this lets through pathological cases such as "_____" which I hadn't originally considered./\b_+(\w+?)_+\b/
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|