Q:

Why does grep require a backslash before a plus sign to treat the plus sign as a quantifier?

I wanted to play a bit with a grep command using regular expressions and found out that they behave differently from what I expected. For example, consider a file temp with the following content
helloworld 
hello_world
hello world
hello how are you world
hello wor   ld
hello_*_..world 
helloEworld

when I run
grep 'hello.*world' temp

it returns
helloworld 
hello_world
hello world
hello how are you world
hello_*_..world 
helloEworld

as expected. But when I run 
grep 'hello.+world' temp

it returns nothing... Though when I add \ before +
grep 'hello.\+world' temp

it returns the correct output
hello_world
hello world
hello how are you world
hello_*_..world 
helloEworld

while adding \  before * in the previous command and running
grep 'hello.\*world' temp

returns nothing...
Why doesn't the grep 'hello.+world' temp command work without the \?
Why is it exactly the opposite for *?
When should I use \?

A:

There are various classes of regular expressions that GNU grep supports:

Basic Regular Expressions (BRE) - the default. Doesn't support + directly, but does support *. You can make + make sense when you escape it \+. From GNU grep documentation:
In basic regular expressions the meta-characters ‘?’, ‘+’, ‘{’, ‘|’,
‘(’, and ‘)’ lose their special meaning; instead use the backslashed
versions ‘\?’, ‘\+’, ‘\{’, ‘\|’, ‘\(’, and ‘\)’.

Extended Regular Expressions (ERE) - the option -E enables this. Supports both + and * directly.
Perl-compatible Regular Expressions (PCRE) - the -P option enables PCRE. Supports syntax similar to Perl's, such as lookaheads and lookbehinds.

BRE and ERE are usually POSIX-defined standard classes, so you should find them on any grep which aspires to POSIX compatibility, and expect to behave similarly.

