On Thu, Jun 16, 2005 at 06:44:50AM +0900, Ezra Zygmuntowicz wrote: > Hello list! > Could someone help me do a little regex conversion? I've got a > few perl compatible regexes from a php script I am trying to port to > ruby but I need a little help. Here are the php functions: > $buffer = preg_replace("#(?<!\"|http:\/\/)www\.(?:[a-zA-Z0-9\-]+\.)* > [a-zA-Z]{2,4}(?:/[^ \n\r\"\'<]+)?#", "http://$0", $buffer); > $buffer = preg_replace("#(?<!\"|href=|href\s=\s|href=\s|href\s=) > (?:http:\/\/|https:\/\/|ftp:\/\/)(?:[a-zA-Z0-9\-]+\.)+[a-zA-Z]{2,4} > (?::[0-9]+)?(?:/[^ \n\r\"\'<]+)?#", "<a href=\"$0\" target=\"_blank\"> > $0</a>", $buffer); > $buffer = preg_replace("#(?<=[\n ])([a-z0-9\-_.]+?)@([^,< \n\r]+)#i", > "<a href=\"mailto:$0\">$0</a>", $buffer); I'm willing to help, but could you give a little more detail on what the regexen should do? -- Best regards, Chris Eidhof