Jump to content

[SOLVED] ereg syntax


WorldDrknss

Recommended Posts

I am having trouble matching a string.

 

String sent from a server:

$Lock PROTOCOL Pk=NAME|

 

Ereg:

if(ereg("^\$Lock\s[*]\s\$Pk\=[*]\|$", $lock_cmd, $matches)){
echo("Good");
} else {
echo("Not Correct");
}

 

This will return "Not Correct" but if I remove "\" from the pipe then it will echo Good. I am trying to get it to match the pipe so it is not seen as an "OR" command.

Link to comment
https://forums.phpfreaks.com/topic/66309-solved-ereg-syntax/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.