tobeyt23 Posted November 21, 2011 Share Posted November 21, 2011 I need to get the set of numbers after '000', so if the number is 111850001. Then I want 1. This is what I tried but not working: ?<=[0]{03} Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/ Share on other sites More sharing options...
tobeyt23 Posted November 21, 2011 Author Share Posted November 21, 2011 Got this to work 0{3} but only want what comes after it Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/#findComment-1290035 Share on other sites More sharing options...
requinix Posted November 21, 2011 Share Posted November 21, 2011 Unless you can't have multiple matching groups (besides $0), just use a simple 000(\d+) Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/#findComment-1290126 Share on other sites More sharing options...
tobeyt23 Posted November 22, 2011 Author Share Posted November 22, 2011 well what is i have 11180000100. I just want the 100? Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/#findComment-1290407 Share on other sites More sharing options...
joe92 Posted November 22, 2011 Share Posted November 22, 2011 Try, 000([1-9]\d+) Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/#findComment-1290409 Share on other sites More sharing options...
tobeyt23 Posted November 22, 2011 Author Share Posted November 22, 2011 Think i got it? $subject = "11180000185"; $pattern = '/000([1-9]\d*)/'; preg_match($pattern, $subject, $matches); print_r($matches); Link to comment https://forums.phpfreaks.com/topic/251548-reg-expression/#findComment-1290426 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.