Help for this page

Select Code to Download


  1. or download this
    1welcometo india.
    ^...............is matched and consumed by ([0-9]+)
     ^^^^^^^........is matched but not consumed by (?=welcome)
     ^..............so "to india" tries to match here and fails.
    
  2. or download this
    $str = '1welcometo india';;
    
    $str =~ m/([0-9]+)(?=welcome)welcometo india/ and print 'matched';;
    matched