Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: Finding specific alphanumeric IDs from the string

by Grimy (Monk)
on May 21, 2012 at 20:09 UTC ( #971686=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Finding specific alphanumeric IDs from the string
in thread Finding specific alphanumeric IDs from the string

local $/; # Slurp for (<DATA> =~ /(?:CWG)?\d{3,}/g) { print "ID: $_\n"; } __DATA__ 123 123456,34567889 12345,CWG123456,1234 "Blah Blah 10-20 m can be taken into consideration 1234556" 123,30,40 http://www.takeithere.com/123456789/fig1,987643,34467889
Outputs:
ID: 123 ID: 123456 ID: 34567889 ID: 12345 ID: CWG123456 ID: 1234 ID: 1234556 ID: 123 ID: 123456789 ID: 987643 ID: 34467889

But is there a precise criteria that you can use to distinguish IDs from other numbers? What if it said "Blah Blah 100m can be taken into consideration 1234556", 100 isn't an ID but would still be matched.


Comment on Re^3: Finding specific alphanumeric IDs from the string
Select or Download Code
Re^4: Finding specific alphanumeric IDs from the string
by Anonymous Monk on May 22, 2012 at 03:19 UTC
    Poor Grimy, you're actually working
Re^4: Finding specific alphanumeric IDs from the string
by Anonymous Monk on May 24, 2012 at 18:52 UTC
    Hey,
    Thanks for the reply...It surely works in all above cases, but my data is really pretty mismanaged and I do not find any specific criteria to match something. Since this is a regression tool it could have any kind of errors made from user's end in the syntax of putting these IDs and I need to catch them :'(. You are right about "What if it said "Blah Blah 100m can be taken into consideration 1234556", 100 isn't an ID but would still be matched." case... Even I am funnily doubtful about the same. Seems like an unending approach.
    Thanks again!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971686]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-07-31 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls