You are here: help with regex « PHP Programming Language « IT news, forums, messages
help with regex

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация