[REBOL] Off-topic: regular expressions
From: mailinglists:post at: 23-Sep-2000 14:31
This is a multi-part message in MIME format.
------=_NextPart_000_0009_01C0256B.015F3900
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hello,
I'm frustrating myself terribly, trying to extract an URL using regular
expressions from the following string:
bla http://www.yahoo.com/blabla.html?this=insane - bla bla
Now how do I do that? I've tried and failed miserably, this is where I
got: (http://|www).*
Which prints out "http://www.yahoo.com/blabla.html?this=insane - bla
bla" - damn these regular expressions! Rebol's 'parse is way better for
this kind of thing, at least I can get 'parse to stop at the first
space!
Thanks in advance!
Regards,
Rachid
------=_NextPart_000_0009_01C0256B.015F3900
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Tahoma size=2>Hello,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>I'm frustrating myself terribly, trying to extract
an URL using regular expressions from the following string:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>"bla <A
href="http://www.yahoo.com/blabla.html?this=insane">http://www.yahoo.com/blabla.html?this=insane</A>
- bla bla"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>Now how do I do that? I've tried and failed
miserably, this is where I got: (<A
href="http://|www">http://|www</A>).*</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>Which prints out "<A
href="http://www.yahoo.com/blabla.html?this=insane">http://www.yahoo.com/blabla.html?this=insane</A>
- bla bla" - damn these regular expressions! Rebol's 'parse is way better for
this kind of thing, at least I can get 'parse to stop at the first
space!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>Thanks in advance!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Tahoma size=2>Regards,</FONT></DIV>
<DIV><FONT face=Tahoma size=2>Rachid</FONT></DIV></BODY></HTML>
------=_NextPart_000_0009_01C0256B.015F3900--