XP is just a number | |
PerlMonks |
Re: Extracting string and numbers from a fileby Athanasius (Archbishop) |
on Apr 29, 2020 at 13:48 UTC ( [id://11116211]=note: print w/replies, xml ) | Need Help?? |
Hello shabird, Your regex says: match one or more word characters, followed by one or more non-word characters, followed immediately by a newline; and return the characters matched minus the newline. This won’t work. What you need is a way to uniquely identify the IDs. From the file contents shown, it looks as though each ID is immediately preceded by a > character. If so, you could use something like this:
Output:
Hope that helps,
In Section
Seekers of Perl Wisdom
|
|