Input line:
<column name="Sample"><![TEST[x-y]]></column>
Output line:
<column name="Sample"><![TEST[y]]></column>
x
is any number
y
is any number
I want to get rid of x-
.
How to do it in Perl? Or maybe it's possible with sed?
Input line:
<column name="Sample"><![TEST[x-y]]></column>
Output line:
<column name="Sample"><![TEST[y]]></column>
x
is any number
y
is any number
I want to get rid of x-
.
How to do it in Perl? Or maybe it's possible with sed?
This regex should do want you want:
$line=~s/(?<=<\!\[TEST\[)\d+\-//;
One-liner flavor:
perl -pe 's/(?<=<\!\[TEST\[)\d+\-//' file.xml
But, as said before in StackOverflow, avoid parsing/processing XML with the use of regular expressions. Use instead a module (eg. XML::Simple).