perl – regex example



use strict;

my $string = "userid_ci_backport_23220998_11.1.2.3.0oiibp";

if( $string =~ m/^[a-z]+_[a-z]+_[a-z]+_([0-9]+)_.+/ ){
  print "$1\n";
}

output :

23220998

Advertisements