Help for this page

Select Code to Download


  1. or download this
    'booga'  =~ /[^.]*/            matches.
    'booga.' =~ /[^.]*/            matches.
    ...
    '4.6.8'  =~ /((?=.*\.))\1(\d)/ returns 8 in $2. .* matched a "4.6"
    '4.6.8'  =~ /.*\.(\d)/         returns 8 in $1. Lookahead not needed.
    '4.6.8'  =~ /(?:(?!\.).)*(\d)/ returns 6 in $1. You want neg lookahead