in reply to Re: regexp: Mind-boggling negative assertions...
in thread regexp: Mind-boggling negative assertions...
Another really nice feature is use re 'debug';:
#!/usr/bin/perl use warnings; use strict; use re 'debug'; "this" =~ /(?<!x)i?/;
Output:
Compiling REx "(?<!x)i?" Final program: 1: UNLESSM[-1] (7) 3: EXACT <x> (5) 5: SUCCEED (0) 6: TAIL (7) 7: CURLY {0,1} (11) 9: EXACT <i> (0) 11: END (0) minlen 0 Matching REx "(?<!x)i?" against "this" 0 <> <this> | 1:UNLESSM[-1](7) 0 <> <this> | 7:CURLY {0,1}(11) EXACT <i> can match 0 times out of 1 +... 0 <> <this> | 11: END(0) Match successful! Freeing REx: "(?<!x)i?"
|
|---|