err0r Posted August 19, 2009 Report Share Posted August 19, 2009 Thanks to LifeIsPain there is now a snippet to strip the style tags for the users that prefer to chat with xchat on buzzen. Save the following as stripstyle.pl in your xchat profile directory and load it. use Xchat qw(:all); use strict; use warnings; register('Strip Style', '001', 'Strip [style][/style] tags'); hook_server('PRIVMSG', sub { my $instring = $_[1][0]; my $edited = 0; # using a while loop instead of /g due to embedded styles while ($instring =~ s/\[style [^\]]*\](.*?)\[\/style\]/$1/i) { $edited = 1; } if ($edited) { command('recv '.$instring); return EAT_ALL; } else { return EAT_NONE; } }); Link to comment Share on other sites More sharing options...
Haggis Posted August 19, 2009 Report Share Posted August 19, 2009 glad you got this as i was getting no where fast Link to comment Share on other sites More sharing options...
err0r Posted August 19, 2009 Author Report Share Posted August 19, 2009 yeah perl isn't my thing either lol Link to comment Share on other sites More sharing options...
Haggis Posted August 19, 2009 Report Share Posted August 19, 2009 as i said to you i learnt perl as i went along doing the one for cusa lol i should really learn regex i worked out a few thing like ^ is at start + mean anything like A+B is A and B and anything in bewteen lol Link to comment Share on other sites More sharing options...
Fanfare Posted August 19, 2009 Report Share Posted August 19, 2009 (edited) and $ is the end of string + means one or more, as in \w+ for instance... Edited August 19, 2009 by Fanfare Link to comment Share on other sites More sharing options...
The Gate Keeper Posted August 19, 2009 Report Share Posted August 19, 2009 easiest way to learn it from my experience is to use an online regex tool. This is a good web app that is a regex tester, and to the right it has quite a few different options and examples. http://gskinner.com/RegExr/ Link to comment Share on other sites More sharing options...
err0r Posted August 19, 2009 Author Report Share Posted August 19, 2009 regex wasn't so much the problem.. i can usually get through any regex that i need.. i just don't know than basic perl or xchat coding. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now