(psk) wrote
> I want to change all the characters after 11 A's (including these A's) to X's.
> somethinglike AAAAAAAAAAA.* should be changed to XXXXXXXXXX....
At first:
$ perldoc -q regex
Secondly:
The replacement of the A's isn't the problem, but I'm not sure how to
acomplish the task of converting _somestuff also into X's, IMHO its
not possible with regex alone... any guru out there may correct me...
$string = "lalalaAAAAAAAAAAA_somestuff";
$string =~ s/(.*?)A{11}(.*)/\\1XXXXXXXXXXX/;
Tommy.
PS: I'm new to perl, coming from php, so all compile errors are by
design =)