From: "Uri Guttman"
"AM" == Alexey Mishustin writes:
AM> I used brackets not for storing but for combining in order to use the
AM> combined patterns in alternation.
the point is parens (the correct term. brackets are []) is they will
grab the match inside them and store it in $1 and friend
1/18/2011, "Uri Guttman" вы писали:
>> "AM" == Alexey Mishustin writes:
>
> AM> 1/18/2011, "Uri Guttman" вы писали:
>
> >>> "AM" == Alexey Mishustin writes:
> >>
> AM> I used brackets not for storing but for combining in order to use the
> AM> combined patterns in altern
> "AM" == Alexey Mishustin writes:
AM> 1/18/2011, "Uri Guttman" вы писали:
>>> "AM" == Alexey Mishustin writes:
>>
AM> I used brackets not for storing but for combining in order to use the
AM> combined patterns in alternation.
>>
>> the point is parens
>> (the corre
> "AM" == Alexey Mishustin writes:
AM> 1/18/2011, "Alexey Mishustin" вы писали:
>> I meant
>>
>> (imgres)
>>
>> OR
>>
>> (images)
>>
>> OR
>>
>> (products)
AM> Uri wrote the correct alternation for that:
AM> (imgres|images|products)
AM> So, I should wri
1/18/2011, "Uri Guttman" вы писали:
>> "AM" == Alexey Mishustin writes:
>
> AM> I used brackets not for storing but for combining in order to use the
> AM> combined patterns in alternation.
>
>the point is parens
>(the correct term. brackets are [])
Eh... Useful correction.
And what is
1/18/2011, "Uri Guttman" вы писали:
>> "AM" == Alexey Mishustin writes:
> AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/
> >>
> >> {0,1} is just ? by itself.
>
> AM> Yes, I know. But I like the {a,b} syntax more :) It's more uniform than
> AM> ?,+,* etc.
>
>it is
> "AM" == Alexey Mishustin writes:
AM> I used brackets not for storing but for combining in order to use the
AM> combined patterns in alternation.
the point is parens (the correct term. brackets are []) is they will
grab the match inside them and store it in $1 and friends. grouping
with
> "AM" == Alexey Mishustin writes:
AM> 1/18/2011, "Uri Guttman" вы писали:
>>> "AM" == Alexey Mishustin writes:
>>
AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/
>>
>> {0,1} is just ? by itself.
AM> Yes, I know. But I like the {a,b} syntax more :) I
1/18/2011, "Alexey Mishustin" вы писали:
>I meant
>
>(imgres)
>
>OR
>
>(images)
>
>OR
>
>(products)
Uri wrote the correct alternation for that:
(imgres|images|products)
So, I should write
/(www\.){0,1}(google\.).*\/(imgres|images|products)\?{0,1}/
--
Regards,
Alex
--
To unsubscribe, e-mai
1/18/2011, "John W. Krahn" вы писали:
>Alexey Mishustin wrote:
>>
>> 1/18/2011, "Grant" вы писали:
>>
>>> I came up with these but they don't seem to work reliably:
>>>
>>> /\.google\..*\/imgres\?/
>>> /\.google\..*\/images\?/
>>> /\.google\..*\/products\?/
>>
>> /(www.){0,1}(google\.).*\/(imgr
Alexey Mishustin wrote:
1/18/2011, "Grant" вы писали:
I came up with these but they don't seem to work reliably:
/\.google\..*\/imgres\?/
/\.google\..*\/images\?/
/\.google\..*\/products\?/
/(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/
That says:
(www.){0,1}
Match a fo
1/18/2011, "Uri Guttman" вы писали:
>> "AM" == Alexey Mishustin writes:
>
> AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/
>
>{0,1} is just ? by itself.
Yes, I know. But I like the {a,b} syntax more :) It's more uniform than
?,+,* etc.
>you don't need to grab things t
> "AM" == Alexey Mishustin writes:
AM> /(www.){0,1}(google\.).*\/(imgres)|(images)|(products)\?{0,1}/
{0,1} is just ? by itself.
you don't need to grab things that are not used later on. also why grab
each trailing word separately which means it will be hard to tell what
word was there.
1/18/2011, "Alexey Mishustin" вы писали:
>
>1/18/2011, "Grant" вы писали:
>
>>> I'm trying to come up with a regex that will match any Google Images
>>> URL such as these:
>>>
>>> www.google.com/imgres
>>> www.google.com/images
>>> google.com/imgres
>>> www.google.co.uk/imgres
>>> www.google.nl
1/18/2011, "Grant" вы писали:
>> I'm trying to come up with a regex that will match any Google Images
>> URL such as these:
>>
>> www.google.com/imgres
>> www.google.com/images
>> google.com/imgres
>> www.google.co.uk/imgres
>> www.google.nl/imgres
>>
>> and a second regex for Google Products UR
> I'm trying to come up with a regex that will match any Google Images
> URL such as these:
>
> www.google.com/imgres
> www.google.com/images
> google.com/imgres
> www.google.co.uk/imgres
> www.google.nl/imgres
>
> and a second regex for Google Products URLs of which this is one example:
>
> www.go
16 matches
Mail list logo