Regex
5または6の整数で始まり、文字で終わるaを作成したいと思います。
私が試してみました
^\d+A-Za-z$
助けてくれてありがとう
Try something like this: You should look into some regex rules, and see other examples on SO.
^\d{5,6}[A-Za-z]$
The main difference is that you need to encapsulate the last rule in [], so it means, one character, either a-z or A-Z. And you need to replace \d+
with \d{5,6}
.
\d+
means: a digit, at least once.
\d{x,y}
: a digit, minimum x times, maximum y times.
You were quite close. Few minor modifications.
^\d{5,6}[A-Za-z]$
Presuming you mean a-z (case insensitive) as "characters" \d{5,6}[a-zA-z]$
This is quite simple though - check out this site for a decent introduction: http://www.regular-expressions.info/