Help for this page

Select Code to Download


  1. or download this
    my $match = /#(\S*)/ ? $1 : "";
    
  2. or download this
    / ^ [^#]* \#? ( \S* ) /x;
    say $1;
    
  3. or download this
    /()/; /#(\S*)/;
    say $1;
    
  4. or download this
    /#(\S*)/ || /()/;
    say $1;
    
  5. or download this
    my $match = /#(\S*)/ ? $1 : "";
    say $match;
    
  6. or download this
    my $match = /#\K\S*/ ? $& : "";
    say $match;
    
  7. or download this
    my ( $match ) = /#(\S*)/;
    say $match;
    
  8. or download this
    my $match = /#(\S+)/ ? $1 : "";
    say $match;
    
  9. or download this
    my $match = /#(\w+)/ ? $1 : "";
    say $match;
    
  10. or download this
    / ^ (?: (?! \#\S ). )* \#? ( \S* ) /x;   # /#(\S+)/
    say $1;
    
  11. or download this
    / ^ (?: (?! \#\w ). )* \#? ( \w* ) /x;   # /#(\w+)/
    say $1;