| View previous topic :: View next topic |
| Author |
Message |
Ofloo Owner
Joined: 13 May 2003 Posts: 953 Location: Belguim
|
Posted: Wed Jun 03, 2009 10:53 am Post subject: regexp problem.. |
|
|
i've got this issue with html tags, .. for some reason
this can be <div id="building_contract2"> or <div id="building_contract">
| Code: | | regexp -nocase {<div id="building_contract"><div class="f10 b">.+?</div>(.+?)</div>} $data > build | works
| Code: | | regexp -nocase {<div id="building_contract2"><div class="f10 b">.+?</div>(.+?)</div>} $data > build | works
| Code: | | regexp -nocase {<div id="building_contract[0-9]{0,1}"><div class="f10 b">.+?</div>(.+?)</div>} $data > build | doesn't work ..
why is that? _________________ XplaiN but think of me as stupid |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Jun 03, 2009 11:07 am Post subject: |
|
|
Just tested with some trivial data, and works just fine for me. You are using non-greedy quantifiers, so I can't see no good reason for the third one failing.
Could you post some real data that works/doesn't work? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
Ofloo Owner
Joined: 13 May 2003 Posts: 953 Location: Belguim
|
Posted: Wed Jun 03, 2009 11:13 am Post subject: |
|
|
it is kindoff a lot .. it's whole html page .. i did some tests to .. on emulated tests it works just fine however on a site it doesn't maybe i'm nto considering all special charaters,.. and should split the data before i regexp it .. i'll let you know how it turns out. _________________ XplaiN but think of me as stupid |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Wed Jun 03, 2009 4:25 pm Post subject: |
|
|
| Ofloo wrote: | | it is kindoff a lot .. it's whole html page .. i did some tests to .. on emulated tests it works just fine however on a site it doesn't maybe i'm nto considering all special charaters,.. and should split the data before i regexp it .. i'll let you know how it turns out. |
This is why Webby was created. You can test/debug regular expressions on a webpage in real time with a pretty standard simple interface. This should help you debug the problem. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Ofloo Owner
Joined: 13 May 2003 Posts: 953 Location: Belguim
|
Posted: Wed Jun 03, 2009 11:05 pm Post subject: |
|
|
it's an page which requires authentication.. but it seems a nice script i often do this from console ..
ctrl u copy paste set data {htmlpage} then test my regexp
EDIT: And it seems to work in real time .. to figur.. _________________ XplaiN but think of me as stupid |
|
| Back to top |
|
 |
|