Help for this page

Select Code to Download


  1. or download this
    while (/(b*)/g) {
    ...
    }
    
  2. or download this
    $perl -e '$_="abbbabc";
    while (/(b*)/g) { print "($1)\n" }'
    ...
    (b)
    ()
    ()
    
  3. or download this
    abba
    | match zero b's before a
    ...
        | match zero b's, don't substitute but bump along
    ^a^^a^
         | match zero b's, don't substitute but bump along
    
  4. or download this
    $ perl -le '$_ = "abba"; s/b*/print pos; "^"/eg; print'
    0
    ...
    3
    4
    ^a^^a^