LOL. As soon as I saw your post I thought to myself "but I tried that". Then it dawned on me that in my tied state I had escaped the forward slash in the closing </span> tag but not the </a>! Thanks. "Zach Dennis" <zdennis / mktec.com> wrote in message news:42153F6D.6030006 / mktec.com... > Paul Wistrand wrote: > > Hi, > > I have a simple project that I thought I'd have a crack at in Ruby. I > > want to retrieve a list of names from a web page but the Ruby interpreter is > > giving me allot of trouble in parsing the pattern for the regular > > expression. The pattern I wanted to use was the following : > > > > pattern = > > /<span\sclass\s=\s"rankingName"><a\shref="w3xp-player-profile.aspx\?Gateway= > > ([^&]*)&PlayerName=([^"]*)">((\n|.)*?)</a></span>/ > > > > understandably the forward slash in the closing span tag causes Ruby to > > think this is the end of the pattern. Hence my question is how the heck do I > > escape this? > > > > Thanks > > Paul > > > > B.T.W I realise that following works just as well... > > pattern = > > /<span\sclass\s=\s"rankingName"><a\shref="w3xp-player-profile.aspx\?Gateway= > > ([^&]*)&PlayerName=([^"]*)">((\n|.)*?)</ > > Just add a \ slash before all characters you want to escape, in this > case the forward slashes. > > example: > rgx = /<\/span>/ > > HTH, > > Zach > >