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.

regex question

Old posts that have not been replied to for several years.
Locked
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

regex question

Post by droolin »

Can anyone direct me to a good tutorial on the regex? The script I wrote looks for a string of words in a text string. Ex: Looking for "OPEN PROXY" in a text string returned in a pubm message to the channel.
I delt with it by using the list, and checking speicific occurances for each word. I know that the regex(hopefully I got that right) can be used. So, I'd like to read up on it if anyone could send me in the right direction.
Thanks.

droolin
User avatar
BarkerJr
Op
Posts: 104
Joined: Sun Mar 30, 2003 1:25 am
Contact:

Post by BarkerJr »

Just use string match :)
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

?

Post by droolin »

I tried to use string match like this: [string match *OPEN PROXY*]
for some reason, it didnt work. Hmmmmm, I was getting syntex error's in that sentence at the time and just removed that sentence and changed how I did it.
So, the string match will reconiethe white spaces???

droolin
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

first.. you don't have the string in which the matching shall take place in that string-match
second, if you are matching with white-spaces you either need to add a ? for every whitespace, or you can just put "'s around it ;)

Code: Select all

[string match "*OPEN PROXY*" $string] 
Elen sila lúmenn' omentielvo
User avatar
droolin
Halfop
Posts: 64
Joined: Thu Jul 24, 2003 9:07 pm
Contact:

ahhh, thanks

Post by droolin »

I didnt have the "" around it. That's why it didnt work. Thank you very much. Think I posted that reply last night around 3am and wasnt with it. when I origionaly tried that I had the variable specified but I didn't have the "" around the full string I was trying to match. Thank you.

droolin
Locked