Re: Regular Expressions Question

2011-04-12 Thread Rob Dixon
On 11/04/2011 15:21, gkl wrote: OK. So if I understood you correctly, given the following (actual) URLs http://beta.images.theglobeandmail.com/archive/01258/election_heads__1258993cl-3.jpg http://storage.canoe.ca/v1/dynamic_resize/?src=http://www.torontosun.com/news/decision2011/2011/04/06/300_

Re: Regular Expressions Question

2011-04-12 Thread C.DeRykus
On Apr 11, 7:21 am, gklc...@googlemail.com (gkl) wrote: > On Apr 10, 11:03 pm, jwkr...@shaw.ca ("John W. Krahn") wrote: stion on regular expressions as my > > > program is working fine but I was just curious. > > > > Say you have the following URLs: > > > >http://www.test.com/image.gif > > >http://

Re: Regular Expressions Question

2011-04-12 Thread gkl
On Apr 10, 11:03 pm, jwkr...@shaw.ca ("John W. Krahn") wrote: > cityuk wrote: > > Dear All, > > Hello, > > > > > This is more of a generic question on regular expressions as my > > program is working fine but I was just curious. > > > Say you have the following URLs: > > >http://www.test.com/image.

Re: Regular Expressions Question

2011-04-11 Thread Rob Dixon
On 11/04/2011 06:43, Shlomi Fish wrote: > On Sunday 10 Apr 2011 14:05:49 cityuk wrote: >> >> This is more of a generic question on regular expressions as my >> program is working fine but I was just curious. >> >> Say you have the following URLs: >> >> http://www.test.com/image.gif >> http://www.te

Re: Regular Expressions Question

2011-04-10 Thread Shlomi Fish
On Sunday 10 Apr 2011 14:05:49 cityuk wrote: > Dear All, > > This is more of a generic question on regular expressions as my > program is working fine but I was just curious. > > Say you have the following URLs: > > http://www.test.com/image.gif > http://www.test.com/?src=image.gif?width=12 >

Re: Regular Expressions Question

2011-04-10 Thread David Christensen
On 04/10/2011 04:05 AM, cityuk wrote: Is there a way to say here is a whole RE, here is another and match the first or the second? Jeffrey E.F. Friedl, 2006, "Mastering Regular Expressions", 3 e., O'Reilly Media, ISBN 978-0-596-52812-6. http://oreilly.com/catalog/9780596528126/ HTH, David

Re: Regular Expressions Question

2011-04-10 Thread John W. Krahn
cityuk wrote: Dear All, Hello, This is more of a generic question on regular expressions as my program is working fine but I was just curious. Say you have the following URLs: http://www.test.com/image.gif http://www.test.com/?src=image.gif?width=12 I want to get the type of the image, i.e

Regular Expressions Question

2011-04-10 Thread cityuk
Dear All, This is more of a generic question on regular expressions as my program is working fine but I was just curious. Say you have the following URLs: http://www.test.com/image.gif http://www.test.com/?src=image.gif?width=12 I want to get the type of the image, i.e. the string gif. For the

Re: Regular expressions question

2009-11-19 Thread mangled...@yahoo.com
> > > Can anyone tell me how to write a regular expression which matches > > > anything _except_ a litteral string ? > One could also use a zero-with negative look-ahead assertion: > > #!/usr/bin/perl -w > > use strict; > > while( my $line = ){ >   if( $line =~ m/^(?!Nomatch)/ ){ >     print "mat

Re: Regular expressions question

2009-11-18 Thread Rob Coops
On Wed, Nov 18, 2009 at 5:05 PM, Thomas Bätzler wrote: > Hi, > > Dermot suggested: > > 2009/11/17 mangled...@yahoo.com : > > > > Can anyone tell me hoq to write a regular expression which matches > > > anything _except_ a litteral string ? > > > > > > For instance, I want to match any line which

AW: Regular expressions question

2009-11-18 Thread Thomas Bätzler
Hi, Dermot suggested: > 2009/11/17 mangled...@yahoo.com : > > Can anyone tell me hoq to write a regular expression which matches > > anything _except_ a litteral string ? > > > > For instance, I want to match any line which does not begin with > > Nomatch.  So in the following : > You would ne

Re: Regular expressions question

2009-11-18 Thread Dermot
2009/11/17 mangled...@yahoo.com : > Hi, Hello, > Can anyone tell me hoq to write a regular expression which matches > anything _except_ a litteral string ? > > For instance, I want to match any line which does not begin with > Nomatch.  So in the following : > > Line1 > Line2 > Nomatch

Regular expressions question

2009-11-18 Thread mangled...@yahoo.com
Hi, Can anyone tell me hoq to write a regular expression which matches anything _except_ a litteral string ? For instance, I want to match any line which does not begin with Nomatch. So in the following : Line1 Line2 Nomatch Line3 Line 4 I would match every line except