Regular Expression |R
Regular Expressio
'\s' : To accept the single white space.
eg: To accept the space along with text need to use.
([a-z]+\s)+
var validate_pattern_azdotspace = "([a-z]+[\\.\\s]?)*[a-z]+";
Use Case: Alphanumeric with space and dot. The expression must contain an alphabet.
Different blocks in expression
- (?=.*[a-z])
- ([a-z0-9]+[\\.\\s]?)*
- [a-z0-9]+[\\s]?
Block 1
Note:
if regex is used in javascript, need to add an escape character
eg : "\s" for single white space, it can be represented in javascript "\\s"
the text should not contain an only numbers, it can accept numbers in between
the text should not contain an only numbers, it can accept numbers in between
Comments
Post a Comment