P
Phil Tomson
I've got a little email filtering program that I've been using for a while
that has the line:
msg.header.split("\r\n").grep(/^From: /)
When I tried to run this script on Ruby 1.8 I got:
"warning: string pattern instead of regexp; metacharacters no longer
effective"
A bit of irb'ing and I determined that the problem is the split("\r\n")
and it'll apparently work fine if I change the string to a regex.
So does this basically mean that if we're using escaped characters in the
split that we can no longer use strings and we must use regexen?
Phil
that has the line:
msg.header.split("\r\n").grep(/^From: /)
When I tried to run this script on Ruby 1.8 I got:
"warning: string pattern instead of regexp; metacharacters no longer
effective"
A bit of irb'ing and I determined that the problem is the split("\r\n")
and it'll apparently work fine if I change the string to a regex.
So does this basically mean that if we're using escaped characters in the
split that we can no longer use strings and we must use regexen?
Phil