Basically, a regular expression is a pattern describing a certain amount of text. Their name comes from the mathematical theory on which they are based. Regular Expression help you search/find specific part inside a particular sentence.
Starting with them most easy example:-
This will match the exact test string. Here \b is used as word boundary.
So you are done with your first example.