Regex


#1

I’ve been trying to challenge myself to learn regex for fun and also because regular expressions are so useful but I can’t seem to get one of the codecademy exercises right despite multiple attempts. The task is to find a regular expression that validates that a string starts with “a”, ends in “z” and contains an indeterminate quantity of characters between “b” and “y”.

This is the closest I’ve gotten:

/^a.[b-y]*z$/

Any ideas what’s missing?


#2

This one works in testing, but without a link to the lesson cannot be tested there.

/a[b-y]*z/gi

What you might be looking for?

https://regexr.com/