There's more than one way to do things | |
PerlMonks |
Re: search and replace desired portion from a lineby thanos1983 (Parson) |
on May 29, 2019 at 08:42 UTC ( [id://11100688]=note: print w/replies, xml ) | Need Help?? |
Hello syedasadali95, I suppose you want to match any single integer from 0-9 after addr:0x*? If this is the case why not simply like:
Also there is no need to escape semicolon character. :) Update: Fellow Monk AnomalousMonk has a point. This is the more correct solution $line1 =~ s/addr:0x[[:xdigit:]]+/addr:$address/;. Since this a hex value and not just a digit. Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
In Section
Seekers of Perl Wisdom
|
|