I want to validate a field which will allow only "xxxx"[not " " or "xxxx"" or somthing else] with regular expression in Jquery validator ,so what the regular expression would be...plzz suggest.
A:
A general regex you should match would be -
^"[x]+"$
(I assume you only want character 'x' as you defined in question and x does not mean 'any character' )
Edit: As per your comment here is the modified regex you should be using -
^"[^"]+"$
Gopi
2010-08-13 06:36:35
Arko
2010-08-13 06:44:45
Edited my answer for same
Gopi
2010-08-13 06:52:57
ok i will try that..and thanx
Arko
2010-08-13 06:54:29
i guess this is not working..earlier i was using /^[a-z0-9_ *-]+$/ this regex,now i just want to add the validation i have already mentioned.wat to do?
Arko
2010-08-13 07:04:57
This is not different than your earlier regex except for addition of quotes. I am not sure why this is not working in your case probably it may require some escaping of quote by prefixing it with '\'.
Gopi
2010-08-13 07:09:44