This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

chanrelay.tcl

Old posts that have not been replied to for several years.
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

it now works... but it didn't remove the () and the [] was that purpose full or is it abit more difficult to remove them???

coz really that's what i want

but other than that it works perfect......

now all that left is to get it all into a mysql database and then setup searching through it... and well you get the drift... that's y i'm learning to use it... and no i don't want anyone to gimme a script to do it. unless there is a prebuilt one.... i wanna create something that is new...
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

TurboChicken wrote:it now works... but it didn't remove the () and the [] was that purpose full or is it abit more difficult to remove them???
It's not difficult at all...in fact it makes things easier as you can ignore those pesky arrow thingies :P I didn't think they were part of the string you were parsing (()&[])
Make the bind mask "#chan1 *)*]*" and change the regexp to

Code: Select all

[regexp {^\((.+?)\)-..-\[(.+?)\](?:-..-\((.+?)\))?$} $a a data1 data2 data3]
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

nope it didn't like that
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

nope i tried a few different variations of that regexp... still not working... and i've come across an error.... where by if the in the first data there is a - then it pulls it out from there???
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

It works just fine for me. What did you try (paste some code) and what strings did you feed it and what error messages/unexpected results did you get?

My test (in tclsh):

Code: Select all

foreach a {
	{(extract_data1)-››-[extract_data2]-››-(Extract_data3)}
	{(extract_data1)-››-[extract_data2]}
	{bla bla bla}
} {
	if {[regexp {^\((.+?)\)-..-\[(.+?)\](?:-..-\((.+?)\))?$} $a a data1 data2 data3]} {
		if {$data3!=""} {
			puts "match 3: $data1 | $data2 | $data3"
		} else {
			puts "match 2: $data1 | $data2"
		}
	} else {
		puts "mismatch: $a"
	}
}
Results in:
match 3: extract_data1 | extract_data2 | Extract_data3
match 2: extract_data1 | extract_data2
mismatch: bla bla bla
Have you ever read "The Manual"?
Locked