I'm trying to extract some fields from a fixed format data, which looks like this:
G1 = DFF(G2)
Say $_ has the above line, and I want to get G1 and G2 after matching it with a suitable reg exp. I'm using this :
if (/(w+)\s*=\s*DFF\((w+)\)/)
{
print "$1, $2";
}
But this isn't printing what I want (prints nothing, which means my pattern is wrong). Can anyone show me what I'm doing wrong (pls be patient, this is my first perl program !!)
if (/(\w+)\s*=\s*DFF\((\w+)\)/)
It's not the parens that are incorrect, it's the word match \w that needs an escape.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With