Re: regex for matching Google URLs

2011-01-18 Thread Octavian Rasnita
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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-18 Thread 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 alternation. >> >> the point is parens >> (the corre

Re: regex for matching Google URLs

2011-01-18 Thread Uri Guttman
> "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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-18 Thread 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 friends. grouping with

Re: regex for matching Google URLs

2011-01-18 Thread Uri Guttman
> "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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-18 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-17 Thread 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\.).*\/(imgres)|(images)|(products)\?{0,1}/ That says: (www.){0,1} Match a fo

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-17 Thread Uri Guttman
> "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.

Re: regex for matching Google URLs

2011-01-17 Thread Alexey Mishustin
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

Re: regex for matching Google URLs

2011-01-17 Thread 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/imgres >> >> and a second regex for Google Products UR

Re: regex for matching Google URLs

2011-01-17 Thread 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 URLs of which this is one example: > > www.go