Regexp problem.
Posted: Sat Nov 15, 2008 6:54 am
Hi,
So I have a string in php that holds html code:
And I try to get the data between [some_stuff] and [some_stuff_ends] with regexp without success. I have tried with this and it does not work.
Has this something to do with line breaks or something else maybe? Anyone got solution?
So I have a string in php that holds html code:
Code: Select all
$string = '
<head>
<title>test</title>
</head>
<body>
<table border="1" cellpadding="2" cellspacing="2">
<tr>
<td valign="top">
[some_stuff]
<a href="#>jottain</a>
[some_stuff_ends]
</td>
</tr>
</table>
</body>
</html>';
And I try to get the data between [some_stuff] and [some_stuff_ends] with regexp without success. I have tried with this and it does not work.
Code: Select all
preg_match('/\[some_stuff\](.+)\[some_stuff_ends\]/',$string,$matches);