regular expression

1 view
Skip to first unread message

Srinivas Golyalla

unread,
Jun 4, 2010, 8:28:26 AM6/4/10
to Ruby on Rails: Talk
Can u help me in simple regular expression that will match the string
‘123_456_7890’ but not ‘123_456_789’.

Frederick Cheung

unread,
Jun 4, 2010, 9:32:15 AM6/4/10
to Ruby on Rails: Talk


On Jun 4, 1:28 pm, Srinivas Golyalla <golya...@gmail.com> wrote:
> Can u help me in simple regular expression that will match the string
> ‘123_456_7890’ but not ‘123_456_789’.

You're going to have to be a little more specific - the regular
expression /0/ matches the first string and not the second but that's
probably not what you wanted.

Fred

Peter De Berdt

unread,
Jun 4, 2010, 9:38:24 AM6/4/10
to rubyonra...@googlegroups.com

On 04 Jun 2010, at 14:28, Srinivas Golyalla wrote:

Can u help me in simple regular expression that will match the string
‘123_456_7890’ but not ‘123_456_789’.

The thing you're asking is not very specific, there's a lot to be interpreted, but this might be what you are looking for: \d{3}_\d{3}_\d{4}


Best regards


Peter De Berdt


Srinivas Golyalla

unread,
Jun 4, 2010, 2:16:33 PM6/4/10
to Ruby on Rails: Talk
ENTER http://rubular.com/

I Need regular expression that will match the string '123_456_7890'
not '123_456_789'

chewmanfoo

unread,
Jun 4, 2010, 4:40:38 PM6/4/10
to Ruby on Rails: Talk
Do you know a site of that quality (rubular.com) for XPath??? That
site rocks!!!

On Jun 4, 1:16 pm, Srinivas Golyalla <golya...@gmail.com> wrote:
> ENTERhttp://rubular.com/

Rob Biedenharn

unread,
Jun 4, 2010, 4:49:13 PM6/4/10
to rubyonra...@googlegroups.com
Well, Google found this one pretty quick:
http://www.mizar.dk/XPath/Default.aspx

Maybe it can find others, too, if that one doesn't work for you.
-Rob

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

Rob Biedenharn http://agileconsultingllc.com
R...@AgileConsultingLLC.com

Srinivas Golyalla

unread,
Jun 5, 2010, 4:22:54 AM6/5/10
to Ruby on Rails: Talk
\d{3}_\d{3}_\d{4}., thats the answer.,

i really appreciate., thanks a lot.

Can you guide me for this please.,
2. In Ruby there is a command called ‘require’. Explain what this
command means and write an example of how it is used to include a Ruby
Gem in a file.

On Jun 4, 4:49 pm, Rob Biedenharn <R...@AgileConsultingLLC.com> wrote:
> Well, Google found this one pretty quick:http://www.mizar.dk/XPath/Default.aspx
>
> Maybe itcanfind others, too, if that one doesn't work for you.
> -Rob
>
> On Jun 4, 2010, at 4:40 PM, chewmanfoo wrote:
>
>
>
> > Do you know a site of that quality (rubular.com) for XPath???  That
> > site rocks!!!
>
> > On Jun 4, 1:16 pm, Srinivas Golyalla <golya...@gmail.com> wrote:
> >> ENTERhttp://rubular.com/
>
> >> I Needregularexpressionthatwillmatchthestring'123_456_7890'
> >>  not'123_456_789'
>
> >> On Jun 4, 9:38 am, Peter De Berdt <peter.de.be...@pandora.be> wrote:
>
> >>> On 04 Jun 2010, at 14:28, Srinivas Golyalla wrote:
>
> >>>>Canuhelpmeinsimpleregularexpressionthatwillmatchthe  
> >>>>string
> >>>> ‘123_456_7890’butnot‘123_456_789’.
>
> >>> The thing you're asking isnotvery specific, there's a lot to be
> >>> interpreted,butthis might be what you are looking for: \d{3}_
> >>> \d{3}_
> >>> \d{4}
>
> >>> Best regards
>
> >>> Peter De Berdt
>
> > --
> > 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-
> > ta...@googlegroups.com.
> > To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com
> > .
> > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en
Reply all
Reply to author
Forward
0 new messages