mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
I'm using a little script to write some information to a file from what a bot says. The thing is, the bot may announce stuff like "faq-s" and i want to replace it with "faqs" when writing it to the file..

Here's the little code i use:
Code:
messed up code:P}


I've tried playing around with $replace($1-,faq-s,faqs) etc, but cant quite figure it out where to put it...

Any help? smile

Last edited by Danko; 25/03/05 03:00 PM.
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
What have you done with the code lol, you've butchered it.

Go back to the last time you asked this, and take a look at my last post. In regex, where you put something means a lot, even 1 character different changes things.

Fex you've left out the x modifier in that second regex, so that those spaces around %a have become real spaces instead of being ignored. Instead you've put the x in the regex that doesn't need it.

And those $+() make no sense, they perform no function in your code.

I also believe the last thing I gave you were $regsubs, and not $regexes.

Anyway, use $replace(%a,faq-s,faqs) it's not the "most" fullproof method, but it'll work fine for you.

You put it in that /write line, instead of the %a.


Gone.
Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
rofl, yeah i did butch it:/ :P
However, it actually worked a lot greater when i modifed it a little bit..:P
(Alltho, i removed it from my post so ppl wont see how much i mess up..hehh).

But ty, ur method worked for my purpose. blush

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yeah removing the code does keep us from seeing it, however, it also prevents us from making other, and sometimes, better suggestions.

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It was butchered regex code, nothing you would be able to assist with unless you have a decent knowledge of the regex syntax.


Gone.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
While I'm only just starting to learn about regex code, even seeing other people's mistakes and then the corrections made is helpful.
Quote:
I've learned more from my failures than my successes


Link Copied to Clipboard