Doubts on Extended Regular Expressions (grep -E)

Screen Link:

As there´s no practice task on this screen, I´d like to confirm if I´ve got it right.

The DQ says:

Blockquote for us to use the functionality of the listed characters as we learned in Python, we should be using the -E option, while quoting the pattern.

So, if I were to find the following match using the terminal: 'w{3}' as it is, should I use -E option on grep:
grep -E 'w{3}' filename ?

@ksenia.kustanovich: here you are refering to which filename? According to an example given by this article:

abc{2}      # matches a string that has ab followed by 2 c
abc{2,}     # matches a string that has ab followed by 2 or more c
abc{2,5}    # matches a string that has ab followed by 2 up to 5 c

so grep -E or simply egrep matches the battern that you have specified, which I’m guessing in this case is www.

Hope this helps!

To add, if you are working on your local machine,

There’s a big differences in how a command is used based on either Linux (GNU) or macOS (BSD) version or other Operating System version, of the command utilities.

awk, grep, sed in macOS most likely are BSD version.

In most tutorial you find online including DataQuest are based on GNU command utilities.

Regardless of whether you used BSD or GNU command utilities, ensure you use the right (BSD or GNU) documentation.

For more information on the command utilities, on the terminal (type text after $)

$ man grep

or using info to determine if grep uses GNU version.

$ info grep

I was referring to a file which name is filename, it was just an example that I invented to illustrate what I mean.

I´ve done some experiments on my terminal meanwhile and indeed the command grep -E 'w{3}' filename worked as expected returning the lines that contain www. Then I tried grep only without an `-E’ option and it didn´t worked as the documentation warns:

Basic vs Extended Regular Expressions
In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).

And the grep 'w\{3\}' filename worked correctly.

I guess my doubts were caused by too technical language of explanations on this screen which might be somewhat difficult to understand for a non-speaker. Nevertheless I´ve had a good practice reading the documentation and trying out examples on my own to confirm that I understand everything correctly.

Thank you!

Do you mean that I can ensure that I use the right documentation by calling it from my terminal?

By the way, if I use Ubuntu on Windows, would it be GNU?