The difference between BRE and ERE
The basic difference between a regular expression (BRE) and extended regular expressions (ERE) is simply the difference between meta-characters (meta charactor) of it .
BRE:. Only ^ $ * [] is metacharacters
ERE:.? ^ $ [] * + () {} | Are metacharacters
BRE and ERE metacharacters
Reference: Shell Regular Expressions
Examples
$echo "abcdefg" | grep 'a.+g' #不匹配任何字符串
$echo "abcdefg" | grep 'a.\+g' #匹配整个字符串
$echo "abcdefg" | grep -E 'a.+g' #使用扩展正则表达式,匹配整个字符串