File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 1
1
cache /*
2
2
config.rb
3
+ * .swp
Original file line number Diff line number Diff line change @@ -115,15 +115,15 @@ def exist?(channel, date=nil)
115
115
116
116
def grep ( channel , keyword , year )
117
117
ans = [ ]
118
- privmsg = /\d \d :\d \d :\d \d < .+:\* \. jp:.+?> (.*)/
119
- notice = /\d \d :\d \d :\d \d \( .+:\* \. jp:.+?\ ) (.*)/
118
+ privmsg = /\d \d :\d \d :\d \d (<|>) .+:\* \. jp:.+?(>|<) (.*)/
119
+ notice = /\d \d :\d \d :\d \d ( \( | \) ) .+:\* \. jp:.+?( \) | \( ) (.*)/
120
120
Dir . chdir ( "#{ Config ::LOG_DIR } /#{ channel } " ) do
121
121
Dir . glob ( "#{ year } .*.txt" ) do |file |
122
122
log = File . read ( file )
123
123
log = NKF . nkf ( "-w" , log )
124
124
log . each_line do |line |
125
125
if line =~ privmsg || line =~ notice
126
- if $1 =~ Regexp . new ( keyword )
126
+ if $3 =~ Regexp . new ( keyword )
127
127
ans << file . scan ( /\d {4}.\d \d .\d \d / ) [ 0 ]
128
128
break
129
129
end
You can’t perform that action at this time.
0 commit comments