Hello perlmonks,
I am attempting pattern match on lines like this:
"Klhl21 NM_001033352 chr4 + 152008890 152017677 152008942 152015628 4 152008890,152012299,152014306,152015334, 152009963,152012705,152014379,152017677,"
I don't know how to write regex with "=~ m/" with an unknown number of commas to get the second two integer groups into memory. There can be a lot of these integers and writing a regex manually is impractical. There must be a smarter way to match the last two integer groups. So far, what I have is:
if (/^(.*)\s+(.*)\s+chr(.*)\s+([+-])\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s ++(\d+)/) {#indexed by RefSeqID
this reads all data but the last two integer groups into %D.
How can I pattern match the last two integer groups, with unknown numbers of alternating "(\d+),(\d+),(\d+)"?
Thanks,
-DEC
In reply to Alternating Integers and Commas in Regex by hailholyghost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |