0

Regex5または6の整数で始まり、文字で終わるaを作成したいと思います。

私が試してみました

^\d+A-Za-z$

助けてくれてありがとう

4

3 に答える 3

5

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.

于 2012-04-23T16:15:28.287 に答える
0

You were quite close. Few minor modifications.

^\d{5,6}[A-Za-z]$

于 2012-04-23T16:15:32.963 に答える
0

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/

于 2012-04-23T16:19:03.187 に答える