egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

regexp problem..

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Ofloo
Owner


Joined: 13 May 2003
Posts: 953
Location: Belguim

PostPosted: Wed Jun 03, 2009 10:53 am    Post subject: regexp problem.. Reply with quote

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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Jun 03, 2009 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Ofloo
Owner


Joined: 13 May 2003
Posts: 953
Location: Belguim

PostPosted: Wed Jun 03, 2009 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Wed Jun 03, 2009 4:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Ofloo
Owner


Joined: 13 May 2003
Posts: 953
Location: Belguim

PostPosted: Wed Jun 03, 2009 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber