How to fix this regex? -


Help in fixing a small thing in this regular expression

  ^ \ D {2} \ - \ d {3} \ - \ d {6}  

Confirm this format 11-111-111111 This is working fine but the last one (6 digits) ) Is also valid over 6 digits. This means that if I put 11-111-11111111 (8 points in the previous section), then the above regex are validating it?

Can anyone tell me how to limit it to 6 points?

I was able to do this by adding $ at end of regex At the end of the match, only 6 points will be identified.

Currently, it matches your 8-digit entry because it starts with the first 6 digits.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -