I have something like this to match: /\/s-#{slot}\/p-#{port}\/sts-#{sts}/ The problem is the variable STS if it is a 1 matches on 1,10,11,12,13 and so on. How do I get it to match only the value and nothing sles? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I have something like this to match: > > /\/s-#{slot}\/p-#{port}\/sts-#{sts}/ > > The problem is the variable STS if it is a 1 matches on 1,10,11,12,13 > and so on. > > How do I get it to match only the value and nothing sles?What follows the sts portion in your string? Is it something like "sts-123-foo" or "sts-123?foo" or something? You need to figure out what that character is and then add it to the regular expression. Or if it''s nothing and that''s the end of the line anchor it with ''$''. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
doh. I do that in the rest of the expression, duh.. Thanks. Mind fart I guess. On Jan 27, 7:15 pm, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> > I have something like this to match: > > > /\/s-#{slot}\/p-#{port}\/sts-#{sts}/ > > > The problem is the variable STS if it is a 1 matches on 1,10,11,12,13 > > and so on. > > > How do I get it to match only the value and nothing sles? > > What follows the sts portion in your string? Is it something like > "sts-123-foo" or "sts-123?foo" or something? You need to figure out > what that character is and then add it to the regular expression. Or > if it''s nothing and that''s the end of the line anchor it with ''$''.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---