mIRC Home    About    Download    Register    News    Help

Print Thread
#155415 06/08/06 08:22 AM
Joined: Feb 2005
Posts: 342
R
Rand Offline OP
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Alright, to start things off with, in "grep" when you search for something in a log, you can do: grep -irhPo "http:\S+" c:/mirc/logs/

Just for a small explanation, the switches, "i" is to make it not case sensitive, r is just a recursive file search, h just hides the file name, P tells it that it's a perl regex, and the suggestion for filter, is "o" in grep this allows it to return only the part that you grepped for.

So what I'm saying is:

filter -wwgO #chan @todayslinks /http:\S+/i

Would filter from #chan to @todayslinks, using regex. The O would simply make it only return the matched text.

So in @todayslinks, you'd have a buffer full of just "http:" links.. (instead of the entire message/topic that they came with)


As a side note, I'm aware that this can be done through scripting, I just figure it'd be faster and more efficient if it was a builtin type of thing.

Code:
; -- Example --
alias ofilter {
  var %in = $active , %out = @ofilter
  set %regex $1-
  window -he %out | clear %out
  filter -wkg $active _ofilter %regex
  window -aw3 %out | unset %regex
}
alias -l _ofilter {
  noop $regex($1,%regex)
  aline @ofilter $regml(1)
}
; -- End of code --

In mIRC (active channel window): /ofilter /(http:\S+)/i

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
This would be very useful indeed smile


Link Copied to Clipboard