From: Finn Koch Date: 2007-08-24T02:23:51+09:00 Subject: String.match on variable holding a regex? Hi, I'm having a little problem with matching a regex against a string. I am storing data in mysql as a regex. At some point I need to match a string to this regex. Here is what I am working with: result = @dbconn.query("SELECT id, to_user_regex FROM next") result.each do |row| @to_user_regex = row[1] @messages << row[0] if @user.match(/@to_user_regex/) end So lets say @user is a string holding 'name1' and @to_user_regex is 'name1|name2'. I'm trying to match this. Does anyone have any ideas as to why this wouldn't be matching? Thanks! upenox -- Posted via http://www.ruby-forum.com/.