Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-09-2013, 01:29 PM   PM User | #1
FSIvan
New to the CF scene

 
Join Date: Feb 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
FSIvan is an unknown quantity at this point
get numbers from string following specific character sequence

hi all. This seems like a good place to find a solution to my problem.

I'm trying to extract 2 sets of numbers from a string (a file name) following specific words within that string. For example I would like to extract the numbers 149 and 3614 following the expressions "jobno_" and "certificate_" from the following string 'jobno_149_certificate_3614_Grandpas_Florist.pdf'

Now I realize I can search for regular expression in a substring by specifying character numbers in the string but i need something a little more dynamic than that as the respective numbers following "jobno_" and "certificate_" will grow in time hence the need to find those words and output the numbers which directly follow them. The problem is that I'm a bit of a php noob and am not sure how to approach this. Any ideas?
FSIvan is offline   Reply With Quote
Old 02-09-2013, 01:59 PM   PM User | #2
FSIvan
New to the CF scene

 
Join Date: Feb 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
FSIvan is an unknown quantity at this point
Ok. Found a solution to the problem.
http://www.bitrepository.com/how-to-...-a-string.html
FSIvan is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:12 PM.


Advertisement
Log in to turn off these ads.