mIRC Home    About    Download    Register    News    Help

Print Thread
#170024 01/02/07 09:01 AM
Joined: Jan 2003
Posts: 36
S
s0tt0 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2003
Posts: 36
I want to get certain string(word) between characters '>' and ':'. How can I strip it out?

Example: some bot says in the channel
"<botname> <COOLCHAN> someone: blablabla"
How can I strip the "someone" string from there (it is between '>' and ':' marks)?

s0tt0 #170025 01/02/07 10:58 AM
Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
/noop $regex(text,/>([a-z]*)\:/i)

That will store (capture) the text in $regml. Your example shows a space after '>' which will change it to

/noop $regex(text,/>\s([a-z]*)\:/i)

Btw, if you need more help feel free to drop by #Regex on Undernet. There's almost always someone around to help out with simple stuff.

Last edited by Thrull; 01/02/07 10:59 AM.

Yar
Joined: Jan 2003
Posts: 36
S
s0tt0 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2003
Posts: 36
thank you so very much!

Joined: Jan 2003
Posts: 36
S
s0tt0 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2003
Posts: 36
Originally Posted By: Thrull
/noop $regex(text,/>([a-z]*)\:/i)

That will store (capture) the text in $regml. Your example shows a space after '>' which will change it to

/noop $regex(text,/>\s([a-z]*)\:/i)

Btw, if you need more help feel free to drop by #Regex on Undernet. There's almost always someone around to help out with simple stuff.

you were right that i had space after the > sign, but the string what comes after that can contain spaces too but it should captur those with it.
like:
<BLA> this is sentence with spaces: oirj ojfojeqofjweoifj

it should capture the whole sentence now like this:
"this is sentence with spaces"

Oh and the sentence can contain ANY characters (except ':')

Last edited by s0tt0; 01/02/07 11:49 AM.
s0tt0 #170029 01/02/07 12:02 PM
Joined: Jan 2003
Posts: 36
S
s0tt0 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2003
Posts: 36
ok i got it already thanks again! laugh
for those who want this kind of thing

$regex(sentencetobechecked,>(.*?):)

Last edited by s0tt0; 01/02/07 12:03 PM.

Link Copied to Clipboard