| Zoffix | cfedde, hehe :) yeah, and I am trying to figure out how to do it with one regex, I got this far --> eval: $thing = 'test';$_ = 'pooktest href="http://seet?testlsls.htmllala"'; s#(?<!")([^\s]*)($thing)([^\s]*)(?!")#$1<b>$2</b>$3#g; $_ |
| buubot | Zoffix: pook<b>test</b> href="http://seet?<b>test</b>lsls.htmllala" |
| marty-ott-athome | Well.. i'll tell you... |
| action | CPAN upload: Gungho-0.02 by DMAKI |
| CPAN | upload: Gungho-0.02 by DMAKI |
| marty-ott-athome | The script queries SNMP statistics on switch interfaces and put them in Postgres. But when I run it in cron, it does between the first 4 and 10 interfaces on the 1st switch and then just stops. <marty-ott-athome> It's bizarre... <marty-ott-athome> <marty-ott-athome> Not a problem at the command line. At command line, I get 24 interfaces on 21 switches. hmm.. |
| thrig | any wacky required ENV set on the command line not set in cron? |
| marty-ott-athome | I did cut out a bunch of code earlier... and it started running in Cron normally but then, I need that code ..about 20 lines.. it's like trying to reduce the code until I find the right thing not that I can think of. I set the same PATH that I use to run the script |
| Zoffix | thrig, what did you mean by "variables" when you've said I can do it with one regex? crap.. I'll just use 2 regexes and an if |
| tanq | Zoffix: |
| Zoffix | yeah? |
| tanq | what if you just replaced spaces wtih <b> |
| Zoffix | hmr? what spaces? |
| tanq | well replace \s+ with one space then replace all single spaces with a <b> i thought you were replacing the tokenized words with spaces except for the url and the url would not have spaces in it |
| Kylixen | where is budda? |
| action | Zoffix 's head explodes. |
| Zoffix | 's head explodes. |
| tanq | of course when i say <b> i mean the correct markup <b></b> |
| Zoffix | If the string has `test` in it I want to change it to `<b>test</b>` no matter where it is UNLESS it is inside of href="" attribute :/ and now I forgot how I wanted to do it with two regexes >_< |
| tanq | oh this is only for the word test? |
| Kylixen | s/`(.*?)`/<b>$1</b>/ |
| Zoffix | No, `test` is a variable that contains a regex. |
| tanq | i'm confused.. i can't help you. heh |
| Zoffix | Yeah, I understand |
| Jmax- | Zoffix: use an HTML parser |
| Zoffix | actually, let me upload the script.. maybe then you will understand |
| Kylixen | "not string" is a bugger. |
| Zoffix | Jmax-, I don't have HTML |
| Jmax- | this is the sort of confusion that occurs from "parsing" strings with regexp |
| mauke | Zoffix: then you don't have an href="" attribute |
| Jmax- | then use a proper parser |