News for hackers. Stuff that matters.
Re:Top Indian CEO: Most American Grads Are 'Unemployable' by adinobro on Monday June 22, 2009 @07:45AM (#668586)
I may be wrong but I'm fairly sure that /ab+/ would not match the string "abc". I might just be using a different library but /ab+/ would match "ab", "abb", "abbb", etc. The plus means one of more of the previous character. /ab?/ would match "abc" though...
Re:Top Indian CEO: Most American Grads Are 'Unemployable' by cousin_it on Monday June 22, 2009 @08:48AM (#668646)
The regular expressions built into many programming languages have the semantics of matching any part of the string, not necessarily the whole string. If you want to match the whole string, you're supposed to put ^ at the beginning and $ at the end, or something like that.
Re:Top Indian CEO: Most American Grads Are 'Unemployable' by khafra on Monday June 22, 2009 @08:44AM (#668641)
It'd match the string, the same way /a/ would match "abcdefg."

grep -o /ab+/ would only show "ab" from "abc"

iirc, /ab(?![^b]+)/ would match "abb" but not "abc"