| revdiablo | fduplex: You might be able to get away with something that extracts the key-value pairs by looking for things surrounding : Since your data looks like fancy formatted key-value pairs |
| Caelum | you should send that example to clpm or something, maybe it's not supposed to lock up perl |
| fduplex | revdiablo: well it can vary somewhat. there are optional sections to it. |
| hobbs | revdiablo: would take some finesse to deal with the things on the right side revdiablo: plus 'stat mods' is a list. But still, it could be broken up considerably |
| Caelum | locks up bleadperl too |
| hobbs | which would implicitly add cut points and keep the match from going nuts |
| Caelum | so what is it doing, backtracking? |
| revdiablo | hobbs: It was just a thought, maybe not one of my best (which isn't saying much) |
| hobbs | revdiablo: sure. Simple solutions are great. Instinct is just telling me that it would end up getting non-simple enough to hurt :) |
| revdiablo | hobbs: Yeah, probably |
| action | Caelum thought perl isn't supposed to go into a backtracking infinite loop, but then it is an NFA... |
| Caelum | thought perl isn't supposed to go into a backtracking infinite loop, but then it is an NFA... |
| revdiablo | fduplex: If nothing else, and you still want to do it in one big match, you can break up the subcomponents of that big pattern for readability s/you can/you probably should/ |
| fduplex | yeah it does need some cleaning up |
| Caelum | fduplex: avoid using +? too, use greedy matches where possible |
| fduplex | I should probably have mentioned it also broke Regex Coach, which is the program I used while writing it. same behaviour, 100% cpu |
| hobbs | Caelum: it's not so much an infinite loop as an "until the heat death of the universe" loop if that helps |
| Caelum | heh, true |
| fduplex | and since it uses pcre I figured it was pcre related |
| merlyn | perlbot, pcre |
| perlbot | PCRE is crap. It is hardly comparable to Perl's regular expression engine. Don't bother inquiring for help with a regular expression in perl related channels as the answer you'll get will most likely not work since PCRE is missing most of the "powerful" features that perl's regex engine contains. See also: LPBD |
| hobbs | ooh yeah, +? and *? can burn you sometimes |
| merlyn | fduplex - you do realize there are "nearly infinite" regex match fails right? |
| fduplex | yeah I can probably get rid of the ? stuff. I just did that because I wasn't sure if the last character would be alphabetical, numeric or something else |
| merlyn | so it isn't "breaking" anything it's just taking a long time to try every possible match combo for example, /^((.*)(.*))*X/ will fail to match "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxY", but it'll take a realy long time to figure it out |
| fduplex | right. I need to be more specific with my pattern |
| cn28h | Is it possible to make perl look somewhere else for modules than the default location? maybe a flag? I'm testing a modification to a module, but I'm not root so I can't install it, and even setting PERLLIB it takes the other one |
| sili | cn28h: perldoc lib |
| Supaplex | perldoc perlrun |
| cn28h | ok, will do |
| merlyn | cn28h - that's a FAQ, jack learn about "perldoc perlfaq" study that table of contents once a week until you have it memorized |
| cn28h | heheh ok |
| merlyn | o How do I add a directory to my include path (@INC) at runtime? |
| spaffum | merlyn you stil around? |