Monday, 19 August 2013

Compilation failed: unknown property name after \P or \p

Compilation failed: unknown property name after \P or \p

Hi I want to match a string: "\par hello \par world"
Against my regexp pattern -> \\par
However, I get a Compilation failed: unknown property name after \P or \p
I believe my regexp rule is treated as a unicode character property. How
do I escape it and run the pattern as it is?
I am including it in a PDO function like so.
function sqlite_regExp($sql,$db)
{
if($db->sqliteCreateFunction("regexp", "preg_match", 2) === FALSE)
exit("Failed creating function!");
if($res = $db->query($sql)->fetchAll()){ return $res; }
else return false;
}
I am calling the function like so
sqlite_regExp("SELECT COUNT(*) FROM table WHERE REGEXP('/\\par/',column)
",$db)

No comments:

Post a Comment