My regex matches the last set of alpha characters in the line, regardless of what I do. I want it to match only the first occurrence.
I have tried using the non-greedy operator, but it stubbornly matches the right-most set of alpha characters, in this case giving $1 the value "Trig", which isn't what I want. I want $1 to be "02.04.07.06 Geerite".
Code
elsif ($line =~ /\s(\d{2}\.\d{2}\.\d{2}\.\d{2}\s[[:alpha:]]*?)/)
{
print OUTPUT "NT5 " . $1 . " | | \n";
}
Source
02.04.07.06 Geerite Cu8S5 R 3m, R 3m, or R 32 Trig
Output
NT2 32 Trig | |
So in other words, I want this output:
NT2 02.04.07.06 Geerite | |