Hi Monks!
I have an xml file where I am trying to read the number located between <customer_id> and </customer_id>. I can't use substr beause the position will not be consistent. I was thinking of split but after doing some research I am not sure it will be possible with it. I was then looking into a regrex exp but i am not too proficient in it and somewhat lost. The length of the number will be consistent though (7).
Could you please help me figure out how I could extract the number between the above mentioned tabs?
eg. <customer_id>1234567</customer_id> how to get 1234567?
Thanks in advance!
Thanks for all the input guys! i ended up using the following:
if($_ =~ /<Customer_ID>(.*)<\/Customer_ID>/) { my $c = $1; }
In reply to Grabbing specific string from a line by sowais
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |