Reputation: 623
I have AUD0.7195
.
I want to mach AUD
in $1
and 0.7195
in $2
.
The amount may vary. It can be positive integer.
I have tried with:
/([A-Z]{3})(\d{+}\.?\d*)/ms;
But it matches nothing. What is wrong? Thanks!
Upvotes: 0
Views: 51
Reputation: 2589
Could you please try this:
my $string = "AUD0.7195";
print "$1\t$2.......\n", if($string=~m/^([\w]{3})([0-9\-\.]*)$/g);
Upvotes: -1
Reputation: 67988
([a-zA-Z]+)(\d+(?:\.\d+)?)
Use this.Yours does not work as \d{+}
does not act as quantifier.
Upvotes: 2