Reputation: 6609
i am trying to validate if string starts with letter k, followed by anything
Expected output :
khtjk
k1234
kq12g
i followed this and this, but it doesnt allow anything after k
this is what i tried :
[RegularExpression("^k", ErrorMessage = "Sorry, enter correct bill no")]
public string StoreBillNo { get; set; }
any help would be great.
Upvotes: 1
Views: 1851
Reputation: 62488
You have to use this regex for capital and small case:
^[kK].*
or use ignore case :
/^k.*/i
OR
"(?i)^k.*"
Upvotes: 3