Monday, December 27, 2010

Re: [Rails] Is apostrophe (') something special in a regex if at end?

On 27 December 2010 16:59, David Kahn <dk@structuralartistry.com> wrote:
>> ...
>> It is the minus that is a special char (as in a-z) if you escape the
>> minus it is ok.
>
> Yes I see you are right ---the weird part is that the minus is getting
> passed not as a special character in the first examples ( "Billy-Bob" =~
> /^[a-zA-Z' -]*$/ returns 0!) .... anyhow, I will remember than and start
> escaping it.

Yes I wondered about that. Either it is a bug or a documented feature
that - does not need to be escaped in some circumstances. Or perhaps
[a-zA-Z -] means something that neither of us understands.

Colin

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate