Fun with Regular Expression
Fun with perl regular expression A) $st = “The programming republic of perl”; $1 = ?, $2 = ? and $3 = ? 1) if($st =~/(.*)(e|r)(.*)$/) 2) if($st =~/(m{1,2})(.*)$/) 3) if($st =~/(.*)(m{1,2})(.*)$/) 4) if($st =~/(.?)(m{1,2})(.*)$/) 5) if($st =~/(.+?)(e|r)(.*)$/) 6) if($st =~/(m{1,2}?)(.*?)$/) 7) if($st =~/(m{1,2}?)(.*?)/) 8 ) if($st =~/(.*})(.*)$/) Answer: 1) $1 = The programming republic … Read more