On Fri Oct 23 10:26:30 2015, blackcatoverw...@gmail.com wrote: > The below code will hang up. > > > > source: > > say '+0877' ~~ /^+/; > > > > I think it should be /^\+/
Yes, you need to quote of backslash the +. The hang is because ^ never matches any chars, so doesn't make progress, so quantifying it will just hang there forever. Since such a thing is non-sensical, it's now outlawed at compile time: ===SORRY!=== Error while compiling -e Can only quantify a construct that produces a match at -e:1 ------> say '+0877' ~~ /^+<HERE>/; Tests in S05-metachars/line-anchors.t.