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} Quote Link to comment 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 Quote Link to comment 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+) Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
joe92 Posted November 22, 2011 Share Posted November 22, 2011 Try, 000([1-9]\d+) Quote Link to comment 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.