Incorrect regex examples in the tutorial?

Hello,

the (excellent!) regex tutorial contains 3 examples which are incorrect IMO:

^r-*\.movie matches a domain like r------movie.com where the number of dashes can be arbitrary (also none)|

^r-?\.movie matches only the domains rmovie.com and r-movie.com but not those with more than one dash

^r-+\.movie matches only the domains with at least one dash, i.e., not rmovie.com

I think the correct code should be:

^r-*movie\.com
^r-?movie\.com
^r-+movie\.com

Or am I missing something?

1 Like

I think you are correct in your assumption - Probably a slight oversight

1 Like

Thanks, @mmotti. Btw., thanks for your regex.list. Very useful!

1 Like

The regex does not need to match the entire domain, only a part of it. Since there was no $ at the end of any of the regex examples, they will match anything that starts with a string that matches that regex. Expanded, the first regex might look like: ^r-*\.movie.*$

@Mcat12 : Yes, I agree. However, I still think that the escaped period in front of movie does not fit the explanations of these examples.

Ah, sorry, I somehow overlooked that.

1 Like