You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by bu...@apache.org on 2001/11/15 09:37:25 UTC

DO NOT REPLY [Bug 4057] - \w does not match underscore

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4057>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4057

\w does not match underscore

bob_dickinson@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|\w does not match underscore|\w does not match underscore



------- Additional Comments From bob_dickinson@hotmail.com  2001-11-15 00:37 -------
I also observed this problem.  I noticed something else: if I wrap the \w in a 
character class by itself (i.e. [\w]) then it does match underscores.  I wrote 
a test app to verify the observed behavior.  The output is provided below:

"\w+" matched target: "a" - matching part was "a" 
"\w+" did not match target: "_"
"[\w]+" matched target: "_" - matching part was "_" 
"^\w+$" did not match target: "under_score" 
"^[\w]+$" matched target: "under_score" - matching part was "under_score" 
"^[\w]+$" did not match target: "under#_score"

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>