ikel
ikel

Reputation: 1978

Please help on regex in c#

im looking for a expression with regex the string has such pattern first 4 digits are numbers starting with one "0", then followed by "w000 or n000 or wd00 or nd00" then 7 digits of any char including [a-z][0-9]

many thanks

Upvotes: 1

Views: 74

Answers (2)

hsz
hsz

Reputation: 152206

You can try with:

0[0-9]{3}[wn][d0]0{2}[a-z0-9]{7}

Upvotes: 3

riwalk
riwalk

Reputation: 14233

Pretty straightforward:

0[0-9]{3}(w000|n000|wd00|nd00)[a-z0-9]{7}

There are plenty of other ways you can represent this, but this should match the string you described.

Upvotes: 4

Related Questions