我試圖做一個正則表達式,消除在我文字中的電子郵件email: [email protected]
剛剛捕獲文本,並用正則表達式
例如:I request information on your project email: [email protected]
所以我這樣做,抓住我「電子郵件: [email protected]」
message ="I request information on your project email. [email protected]"
message.gsub!("/(email: [-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$)/i")
它返回我什麼,我想有隻在消息文本中。
感謝
在您的示例消息中沒有'email:'only'ema il.'存在。 – Bala 2014-11-04 11:17:40