Hallo all, can someone tell me what can be the regulare expression for this: "The Road", "The Road 12", "Road", "On the Road 89". -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Thu, Feb 19, 2009 at 4:05 PM, Hello Guy <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hallo all, > > can someone tell me what can be the regulare expression for this: > "The Road", "The Road 12", "Road", "On the Road 89". > -- > Posted via http://www.ruby-forum.com/. > > > >If you want to match all strings, /Road/ will work Andrew Timberlake http://ramblingsonrails.com http://www.linkedin.com/in/andrewtimberlake "I have never let my schooling interfere with my education" - Mark Twain --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 19, 2009, at 9:05 AM, Hello Guy wrote:> Hallo all, > > can someone tell me what can be the regulare expression for this: > "The Road", "The Road 12", "Road", "On the Road 89".Your question doesn''t make sense. Do you mean a regular expression that will match ''Road'' in each of those? If so, it''s easy /Road/, but I suspect you''ll want to expand your question a bit. -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Biedenharn wrote:> On Feb 19, 2009, at 9:05 AM, Hello Guy wrote: >> Hallo all, >> >> can someone tell me what can be the regulare expression for this: >> "The Road", "The Road 12", "Road", "On the Road 89". > > > Your question doesn''t make sense. Do you mean a regular expression > that will match ''Road'' in each of those? If so, it''s easy /Road/, but > I suspect you''ll want to expand your question a bit. > > -Rob > > Rob Biedenharn http://agileconsultingllc.com > Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.orgok i ask so: is this ok for like this "The Road", "The Road 12", "Road", "On the Road 89": /^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/ -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 19 Feb 2009, at 15:34, Hello Guy wrote:> > ok i ask so: > is this ok for like this "The Road", "The Road 12", "Road", "On the > Road 89": > /^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/Try it yourself in irb :-) Fred> > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Guy wrote:> /^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/Uh, what does (\s{1})* do? In general, you cannot validate at this level of detail, because addresses like "The Batman, c/o Gotham City PD" will always fail. With terrible consequences... --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Hello Guy wrote: > >> /^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/ > > Uh, what does (\s{1})* do? > > In general, you cannot validate at this level of detail, because > addresses like > "The Batman, c/o Gotham City PD" will always fail. With terrible > consequences...hmm, what do you propose? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> In general, you cannot validate at this level of detail, because >> addresses like >> "The Batman, c/o Gotham City PD" will always fail. With terrible >> consequences... > > hmm, what do you propose?Reward your customer, such as with free software, for providing correct info? (-: --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip wrote:> Hello Guy wrote: > >> /^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/ > > Uh, what does (\s{1})* do? > > In general, you cannot validate at this level of detail, because > addresses like > "The Batman, c/o Gotham City PD" will always fail. With terrible > consequences...This is correct for streetnames in germany, these are for example: "Road", "This Road", "My Road 8" I have write 8 tests and their validates in model. It works great. Then I write def test_street_validate assert_match(/^[[:alpha:]]+(\s{1})*([[:alpha:]])*(\d)*$/, "Deine Strasse") end but i didnt write this validation in model and i do the test: there are no failures or errors. i thought their must be one failure because his validation isnt in model? then when i write the street validation in model and do the test now, there are 3 failures in 3 different tests. whats that? please help -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---