In PERL, I'm trying to use a regular expression that will replace two digits at the beginning of a string with 'testtext'. There will be instances of strings that have 0, 1, 2, and more digits at the beginning, but I only want to substitute 'testtext' for those strings that have EXACTLY two digits at the beginning. For instance:
1Sallywentthisway --> gets skipped in the replace for having only 1 digit
00tomwentthatway --> 00 is replaced with testtext
123joestayedstill --> gets skipped in the replace for having over 2 digits
11Billisgone --> 11 is replaced with testtext
This line of PERL code is not enough:
$segment =~ s/^\d{2}/testtext/;
That code will change the 123joestayedstill to testtext3joestayedstill
Where is my regular expression out of joint?
THANK YOU!