php - How to join N regex patterns into one -
i have few patters these:
$confirm = '~/[a-z][a-z]/confirm\?hash=[0-9a-za-z]+~u'; $letter = '~/[a-z][a-z]/letter/[0-9a-za-z]+~u'; $tracker = '~/[a-z][a-z]/(tracker\?hash)=[0-9a-za-z]+~u'; preg_match($confirm, $text);
they work fine.
how can join these 3 patterns one? have tried |
conditional, it's not working.
i need like:
preg_match ($confirm or $letter or $tracker, $text) if match found ok
you try put 3 patterns one:
$pattern = '~/[a-z][a-z]/(confirm\?hash=|letter|tracker\?hash=)[0-9a-za-z]+~u'; preg_match($pattern, $text);
Comments
Post a Comment