Web Hosting Talk







View Full Version : Using Regular Expression to...


NetVer
12-29-2004, 07:16 AM
I want to get any word what I wanted from the HTML codes.If the Regular Expression can do it?
thanks a lot.:)

unlucky1
12-29-2004, 11:50 AM
I don't understand. Do you mean in this context:
<html>
<body>
find this lalala word
</body>
</html>

You want to be able to find lalala?

azizny
12-29-2004, 01:42 PM
and.... which language :)

Peace,

NetVer
12-29-2004, 09:42 PM
Originally posted by unlucky1
I don't understand. Do you mean in this context:
<html>
<body>
find this lalala word
</body>
</html>

You want to be able to find lalala?

For example

<html>
<body>
<table>
<tr>
<td><font size="3">Name: ICQ</font></td>
</tr>
</table>
</body>
</html>

I want to get ICQ.

NetVer
12-29-2004, 09:47 PM
Originally posted by azizny
and.... which language :)

Peace,

PHP or ASP,just use regular expression.
:)

Burhan
12-30-2004, 08:16 AM
preg_match_all("|Name:(.*?)|im",$haystack,$matches);
echo "<pre>"; print_r($matches); echo "</pre>";