Need to create an expression

zorg

New member
Joined
Apr 13, 2004
Messages
1
Hi Guys,

Im just a beginner as far as regular expressions are concerned, so I need some help on creating an expression. I guess it should not be an issue...so here is what I need:

Everything is allowed except the following (comma separated): <, >, --, \n, \r

A single hyphen is allowed but more than 1 consecutive hyphen is not. "\n" and "\r" are literal text and not new line i.e. user should be restricted from entering "\n" or "\r" in the textboxes, whereas a new line (return) is allowed.

Your help is appreciated. I need this urgently. Thanks guys.
 
try this ^([\w_\.,]+(\-?[\w_\.,]+)+)$
allowed all numbers, characters, ".", ",", "_"
f.i. this word allowed s77df-s,df-s.ss

replace string \w_\., with your own if you need other symbols like ";" "@" ...
 
Back
Top