Re: Re: Regular expression: How do I allow forward slashes?

maryam kamali
Sun, 20 Dec 2009 06:46:49 -0000

hello iam maryam ihave peroblem ishal go aftenon by

On Sat, Dec 19, 2009 at 11:21 AM, ralu
<ralu.rm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

>
>
> On Dec 18, 11:01 pm, AlwaysCharging
<goodg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > In my app, I allow users to submit urls.  They (of course) need the
> > ability to submit urls with a forward slash, "/", but whats
the
> > regular expression to allow them to do that?
> >
> > I currently use:
> >
> > validates_format_of :url, :with => /^[-\w\_.]+$/i
> >
> > to only allow alphanumerics, dashes, underscores, and dots to prevent
> > cross site scripting when I later reconstruct these urls, but I
can''t
> > figure out how to allow "/" as well.
> >
> > Any ideas?
>
>
> am a newbee.. but i think u can use underscore method for the whole
> url that will put ''/'' instead of '' : ''
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
>
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.