Help for this page

Select Code to Download


  1. or download this
    for( 'hd_defect-onomatopeia', 'hd_defect-host.foo.bar.com' ){
        if( m{hd_defect-( ([^\.]+$) | (?: ([^\.]+).(.+$) ) )}sx ){
          my $fqdn = $1;
    ...
    __END__
    fqdn( onomatopeia) host( onomatopeia) dom( onomatopeia )
    fqdn( host.foo.bar.com) host( host) dom( foo.bar.com )
    
  2. or download this
    use YAPE::Regex::Explain;
    print YAPE::Regex::Explain->new(
    qr{hd_defect-( ([^\.]+$) | (?: ([^\.]+).(.+$) ) )}sx
    ...
    )                        end of grouping
    ----------------------------------------------------------------------