Originally Posted By: Tomao
Originally Posted By: Wiz126
there is no escape sequences for match texts.
You're correct. I totally overlook that. But by using the octal char, it will work:
Code:
/^!foo\72bar\S+/


You missed what he was trying to do, he knows about hex, as he stated:

Quote:
Can give the hex for the colon if it is part of the pattern, but pcre also has ?: for noncapturing subpatterns.


He is not trying to use a colon as a character literal, he is trying to use it for a non-capturing pattern. for example (?:foobar), unlike (\x3Afoobar) which is literally ":foobar". In such case ':' must be a ':', you cannot escape it.

Last edited by Wiz126; 15/03/11 08:10 PM.