質問

Hi everyone i need a Regex the first letter needs to be 'L' uppercase and the rest only numbers the size needs to be 9.

Actually I'm using this:

Regex RgxUrl = new Regex("[^a-z0-9]");

Thanks.

役に立ちましたか?

解決

Your regex should be

^L[0-9]{8}$

^ marks the beginning of string/line and $ marks the end of string/line

{8} is a qauntifier which would match 8 digits.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top