How can I find the first substring until I find the first digit?
Example:
my $string = \'AAAA_BBBB_12_13_14\' ;
Result expected: \'AAA
Judging from the tags you want to use a regular expression. So let's build this up.
\D
This gives us the following regular expression:
^\D+
Which we can use in code like so:
my $string = 'AAAA_BBBB_12_13_14';
$string =~ /^\D+/;
my $result = $&;