"Reseller PO - 23213123-123-232331"
All I need is the number. I tried (Reseller PO\s*-.\A*) it works with one online regex tester but not some others so I must have something wrong..
Help...
Moderator: General Moderators
It depends upon what language you're using and how it returns matches. You should be able to pull the match for the first capture group (). In PHP it would be $matches[1] for this:rlobianco wrote:That syntax seems to pull the entire string..I need to just pull the number after the dash. The number can vary greatly though, Some are in the format I posted and some are just number with no dashes. I thought the \A would start the capture at the number.
Regards,
Ralph
Code: Select all
preg_match('/Reseller PO - ([-\d]+)/', $search_string, $matches);Code: Select all
preg_match_all('/Reseller PO - ([-\d]+)/', $search_string, $matches);Code: Select all
Array
(
[0] => Array
(
[0] => Reseller PO - 23213123-123-232331
)
[1] => Array
(
[0] => 23213123-123-232331
)
)