regural expression with not condition.
- From: Vamsi Krishna <vamsikrishna.naidu@xxxxxxxxx>
- Date: Sat, 24 Jan 2009 15:05:46 -0500
Hi all,
i'm trying validate the format which doesn't consist of an empty string
in the single or double quotes.
validates_format_of :name,:with=>/^['"][ ]*['"]$/ ,:on=> :create
/^['"][ ]*['"]$/ it does validation for like the string ' ' and " " . i
need except this like the string may contain "vamsi" or 'vamsi' or
"vamsi's" all these three are valid for me.
so how to modify the above expression is there any thing like
:without? (ofcourse there is no)
or can we put a not condition for the regular expression
like !(/^['"][ ]*['"]$/)
Thanks
VK.
--
Posted via http://www.ruby-forum.com/.
.
- Follow-Ups:
- Re: regural expression with not condition.
- From: Brian Candler
- Re: regural expression with not condition.
- From: Brian Candler
- Re: regural expression with not condition.
- From: Yaser Sulaiman
- Re: regural expression with not condition.
- Prev by Date: Re: how to find the position of each match within a string
- Next by Date: how to require more than one thing from the command line
- Previous by thread: secure client api for a web service
- Next by thread: Re: regural expression with not condition.
- Index(es):
Relevant Pages
|
Loading