How can I extract a substring up to the first digit?

后端 未结 4 1174
名媛妹妹
名媛妹妹 2021-01-15 09:01

How can I find the first substring until I find the first digit?

Example:

my $string = \'AAAA_BBBB_12_13_14\' ;

Result expected: \'AAA

4条回答
  •  渐次进展
    2021-01-15 09:14

      $str =~ /(\d)/; print $`;
    

    This code print string, which stand before matching

提交回复
热议问题