Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread gvim
The 4th edition of the Camel states: * 0123456789 =~ /(\d{3})/g returns only three strings: 012, 345, and 678. By wrapping the capture group with a lookahead assertion: 0123456789 =~ /(?:(\d{3}))/g you now retrieve all of 012, 123, 234, 345, 456, 567, 678, and

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Abigail
On Wed, Jun 19, 2013 at 02:36:14PM +0100, gvim wrote: The 4th edition of the Camel states: * 0123456789 =~ /(\d{3})/g returns only three strings: 012, 345, and 678. By wrapping the capture group with a lookahead assertion: 0123456789 =~ /(?:(\d{3}))/g you

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Gianni Ceccarelli
I'd say typo in the book. A look-ahead assertion looks like C (?= ) (note C= instead of C:). C (?: ) is just a non-capturing group. $ perl -E 'say for 0123456789 =~ /(?=(\d{3}))/g' 012 123 234 345 456 567 678 789 -- Dakkar - Mobilis in mobile GPG public key

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread gvim
On 19/06/13 14:52, Abigail wrote: That's not a lookahead assertion. This is: $ perl -wE 'say for 0123456789 =~ /(?=(\d{3}))/g' 012 123 234 345 456 567 678 789 $ So there's a typo on p.248 gvim

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Dave Cross
Quoting gvim gvi...@gmail.com: On 19/06/13 14:52, Abigail wrote: That's not a lookahead assertion. This is: $ perl -wE 'say for 0123456789 =~ /(?=(\d{3}))/g' 012 123 234 345 456 567 678 789 $ So there's a typo on p.248 Patches welcome -

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Tom Hukins
On Wed, Jun 19, 2013 at 03:02:32PM +0100, gvim wrote: On 19/06/13 14:52, Abigail wrote: That's not a lookahead assertion. So there's a typo on p.248 Yes, and it's listed in the errata on the publisher's Web site: http://oreilly.com/catalog/errata.csp?isbn=9780596004927 Tom

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Bob MacCallum
so, forgetting the typo for a moment, why doesn't it output 012 012 012 012 ... ? From my reading of the 5.12 perlre docs, there is no mention of moving the cursor along by one position after each match. Maybe that is a more general thing I wasn't aware of. On Wed, Jun 19, 2013 at 3:02 PM,

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Bob MacCallum
I was thinking you'd have to use something like this perl -wE 'say for 0123456789 =~ /(\d(?=(\d{2})))/g' 0 12 1 23 2 34 3 45 4 56 5 67 6 78 7 89 obviously with some post-processing required. On Wed, Jun 19, 2013 at 3:28 PM, Bob MacCallum uncool...@gmail.com wrote: so, forgetting the typo

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Gianni Ceccarelli
On 2013-06-19 Bob MacCallum uncool...@gmail.com wrote: so, forgetting the typo for a moment, why doesn't it output 012 012 012 012 ... ? From my reading of the 5.12 perlre docs, there is no mention of moving the cursor along by one position after each match. Maybe that is a more

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Aaron Crane
Bob MacCallum uncool...@gmail.com wrote: From my reading of the 5.12 perlre docs, there is no mention of moving the cursor along by one position after each match. Maybe that is a more general thing I wasn't aware of. Yes, though only when the match was zero-length. This is done on the grounds

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Yitzchak Scott-Thoennes
On Wed, Jun 19, 2013 at 7:28 AM, Bob MacCallum uncool...@gmail.com wrote: so, forgetting the typo for a moment, why doesn't it output 012 012 012 012 ... ? From my reading of the 5.12 perlre docs, there is no mention of moving the cursor along by one position after each match. Maybe

Re: Regex lookahead example not as stated in Camel 4th

2013-06-19 Thread Bob MacCallum
thanks everyone for pointing out what I hadn't seen in the docs. On Wed, Jun 19, 2013 at 4:00 PM, Yitzchak Scott-Thoennes sthoe...@gmail.com wrote: On Wed, Jun 19, 2013 at 7:28 AM, Bob MacCallum uncool...@gmail.com wrote: so, forgetting the typo for a moment, why doesn't it output 012

New pet keeping rules in the Netherlands

2013-06-19 Thread Dirk Koopman
It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears one may keep a water buffalo but, crucially, one will *not* be able to keep a camel. Apparently, camels are dirty, disease ridden animals

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Elizabeth Mattijsen
On Jun 19, 2013, at 9:15 PM, Dirk Koopman d...@tobit.co.uk wrote: It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears one may keep a water buffalo but, crucially, one will *not* be able to

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Paul Makepeace
Wow, and I thought Oakland (California) was permissive allowing us, in a large (~1M pop.) city, to keep cows and horses. You need an acre minimum for a horse, but so long as you can demonstrate adequate manure processing capacity, cows are a go. Where is this fabulous discussion happening? Is

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Elizabeth Mattijsen
On Jun 19, 2013, at 9:55 PM, Paul Makepeace pa...@paulm.com wrote: On Wed, Jun 19, 2013 at 12:15 PM, Dirk Koopman d...@tobit.co.uk wrote: It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Mark Overmeer
* Paul Makepeace (pa...@paulm.com) [130619 20:04]: Wow, and I thought Oakland (California) was permissive allowing us, in a large (~1M pop.) city, to keep cows and horses. You need an acre minimum for a horse, but so long as you can demonstrate adequate manure processing capacity, cows are a

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Dirk Koopman
On 19/06/13 20:55, Paul Makepeace wrote: Wow, and I thought Oakland (California) was permissive allowing us, in a large (~1M pop.) city, to keep cows and horses. You need an acre minimum for a horse, but so long as you can demonstrate adequate manure processing capacity, cows are a go. Where is

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Kieren Diment
Apparently the Easter Quoll (http://en.wikipedia.org/wiki/Eastern_quoll) is a good replacement for a cat. However the australian regulatory environment makes this very difficult to do. On 20/06/2013, at 5:55 AM, Paul Makepeace pa...@paulm.com wrote: Wow, and I thought Oakland (California)

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Dominic Humphries
Excellent! Sensible policies for a happier Britain! On Wed, 2013-06-19 at 20:15 +0100, Dirk Koopman wrote: It appears that my esteemed government has changed the rules about about which pets one might keep at home. Apart from all the usual suspects, it appears one may keep a water buffalo

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Andrew Beattie
On 19 Jun 2013, at 21:23, Mark Overmeer m...@overmeer.net wrote: The first has the usual suspects like bears, skunk, dingo, various foxes, racoon, but also the Elk(!) and wallabies (deceases). That's a shame, since the Russians spent 50 years breeding tame foxes:

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Damian Conway
Apparently the Easter Quoll is a good replacement for a cat. Except that it's a species of Australian wildlife. And nocturnal. Which means that it will wait until you fall asleep before it kills you. Damian

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Wendy G.A. van Dijk
At 09:55 PM 6/19/2013, Paul Makepeace wrote: Wow, and I thought Oakland (California) was permissive allowing us, in a large (~1M pop.) city, to keep cows and horses. You need an acre minimum for a horse, but so long as you can demonstrate adequate manure processing capacity, cows are a go. Where

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Paul Makepeace
On Wed, Jun 19, 2013 at 1:25 PM, Dirk Koopman d...@tobit.co.uk wrote: An URL in English: http://www.dutchnews.nl/news/archives/2013/06/new_official_rules_you_can_kee.php The approved list contains animals such as dogs, cats, hamsters, mink and water buffalo. I'm sorry but one of these animals

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Roger Bell_West
On Thu, Jun 20, 2013 at 07:14:42AM +1000, Damian Conway wrote: Except that it's a species of Australian wildlife. Are you sure? It's not venomous.

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread Damian Conway
The discussion is in the Dutch Parliament and it's committees. Maybe a bit far out of reach for you :-) Not really: I do live in New Holland, after all. (https://en.wikipedia.org/wiki/New_Holland_%28Australia%29) ;-) Damian

Re: New pet keeping rules in the Netherlands

2013-06-19 Thread James Laver
On 19 Jun 2013, at 22:14, Damian Conway dam...@conway.org wrote: Except that it's a species of Australian wildlife. And nocturnal. Which means that it will wait until you fall asleep before it kills you. Skippy, skippy, skippy the bush kangaroo-oo James