| 
	
 | 
 Posted by Marcus on 08/03/06 21:59 
Hello, 
 
I am trying to include the literal '\' (backslash) character in a regex.  
  I am not sure if I need to escape it, however... 
 
 From http://www.regular-expressions.info/charclass.html: 
"To include a backslash as a character without any special meaning  
inside a character class, you have to escape it with another backslash.  
[\\x] matches a backslash or an x." 
 
 From http://www.tin.org/bin/man.cgi?section=7&topic=regex: 
"...all  other  special  characters, including `\', lose their special  
significance within a bracket expression." 
 
These seem to contradict each other.  Both ways *seem* to work, but I am  
not familiar enough with regex's to know if one is producing some other  
side effect that I am not aware of.  Thanks a bunch for your help.
 
  
Navigation:
[Reply to this message] 
 |