From: Markus Schirp Date: 2007-10-01T21:13:35+09:00 Subject: Re: regexpression: scanning a special charachters // ? Am Mon, 1 Oct 2007 21:05:06 +0900 schrieb kazaam : > Hi again, > I need to parse a line like this here: > > myoverlook://thatstrue@blablabla > > I need at the end just thatstrue. So I wrote for the beginning: > > result = overlook.scan(/myoverlook://(.+?)\n/m) > > Of course this doesn't work because of the // which are special > charachters in a regexpr. But how can I tell that they shoudln't be > treated as specialcharachters? Is there an escape charachter? I tried > it so: > > result = overlook.scan(/myoverlook:\/\/\(.+?)\n/m) > > but this throws an error: unmatched ): /myoverlook:\/\/\(.+?)\n/ > > What's the correct synthax for this? > > bye You escaped the ( to, so that your cloasing ) is unmatched... /myoverlook:\/\/\(.+?)\n/m <- yours /myoverlook:\/\/(.+?)\n/m <- more correct (untested)