Your regex should match the string Z97

i have tried every code on this task regular expressions but still current code is not matching the string Z97, this is my current code; /^[a-zA-Z]{2,}\d*$/

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Can you describe what this part of your expression does:

{2,}

regex generator
delete comma…

{2,} makes sure that there are atleast two consecutive letters in regex partern

same thing my regex is still not matching the string Z97 , i dont jus get it

The regex is looking for two letters, but the test only has one letter.

{2,} makes sure that there are atleast two consecutive letters in regex partern

1 Like
^Z[0-9]{2}$

“Z” followed by exactly two digits, and nothing more before or after this pattern.
matches strings like “Z97,” “Z42,” and “Z09,”

zaklina thanks alot it finally worked jus that i have a longer code than i expected

1 Like

thanks alot. @zaklina

1 Like