Tuesday, March 30, 2010

Validating ViewModel use Regular Expression

What do you think about Regular Expression(RE)?
Today, when working on RE in Validate ViewModel (used DataAnnotation), I just found important thing in RE. After reading about it, I implemented something very interested in it.
For examples:
In bussiness rule request me validate for string not contain any speial characters. So I can use this pattern ^[(0-9|a-z|\s|A-Z\.)]*$. It's so good. We can used this tool for validate string.
I also found useful stuff at here. This is very easy for understanding. In real working, RE's really important, and it make my work is easier. But we always had some problems when using it :D.

No comments:

Post a Comment