|
-
Jan 16th, 2013, 07:51 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Getting the number from the string
Hi Guys.
I am looking for a little advice on how I can do something. Please give me your suggestions.
Pretend I have some string values like this:
Document1_789123456.docx
3rd_Notice_123456789_Final.pdf
001002003_SallySample_Upload.xls
I know I can use RegEx to find out if the strings have a nine digit employee number in the string. But I also want to get the 9 digit employee number from the file.
How would you recommend I get the 9 digit employee number? It’s important that I get all 9 digits. If the number if 8 digits long, then it’s not the employee number.
Since RegEx only tells me if the value exists (and not where in the string it exists), I was thinking maybe I could loop through the string and count how many numbers in a row I find.
What do you think? Is there a better way?
~Peter

Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|