How do you use a plus symbol with a character class as part of a regular expression?
问题 in cygwin, this does not return a match: $ echo "aaab" | grep '^[ab]+$' But this does return a match: $ echo "aaab" | grep '^[ab][ab]*$' aaab Are the two expressions not identical? Is there any way to express "one or more characters of the character class" without typing the character class twice (like in the seconds example)? According to this link the two expressions should be the same, but perhaps Regular-Expressions.info does not cover bash in cygwin. 回答1: grep has multiple "modes" of