Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Word Loop (#149)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michal Suchanek  
View profile  
 More options Dec 10 2007, 7:50 pm
Newsgroups: comp.lang.ruby
From: Michal Suchanek <hramr...@centrum.cz>
Date: Mon, 10 Dec 2007 19:50:09 -0500
Local: Mon, Dec 10 2007 7:50 pm
Subject: Re: [QUIZ] Word Loop (#149)
On 11/12/2007, Joe <qbpro...@gmail.com> wrote:

> /(.*?)(.)(.(?:..)+?)\2(.*)/i

> break it up:
> (.*?) looks for a non-greedy string of anything
> (.) any character
> (.(?:..)+?) non-greedy matching of an odd number of characters.  I'm
> not sure what the ?: adds to the regular expression.
> I got this: "(?: )      grouping without backreferences" from here:
> http://www.zenspider.com/Languages/Ruby/QuickRef.html#11

Yes, makes sense. This group would not be used in the match result.

> \2 matches the any character from before

I wonder if these are still regular epxpressions with those backreferences.

> (.*) a string of any length at the end

> i - at the end that means case insensitive.

> Joe

Thanks for the nice explanation.

Michal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.