Using .NET Regular Expression, match any string with exactly 9 digits

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2010-05-21T16:26:31Z Indexed on 2010/05/21 16:30 UTC
Read the original article Hit count: 170

Filed under:

I'm trying to create a regex expression to match any string that has exactly 9 digits. the digits can exist anywhere in the string.

For example, if you passed in the following strings, you'd get a match: 123456789 123aeiou456abc789

These strings would fail to provide a match 12345678 1234567890

© Stack Overflow or respective owner

Related posts about regex