PHP RegEx woes

Associate
Joined
23 Mar 2009
Posts
348
Location
Midlands
Hey all!

Still fairly new to RegEx, and really struggling to find an expression to get the URL out of this text:

PHP:
<script type="text/javascript">
					document.write('<li><a href="/oyster/journeyHistoryThrottle.do?_qs=_qv%3Dc2115ef6e2db4509db5d5f1b044f09009b4d3e30">Journey history</a></li>');
				</script>
				<noscript>
					<li><a href="/oyster/journeyHistory.do?_qs=_qv%3Dc2115ef6e2db4509db5d5f1b044f09009b4d3e30">Journey history</a></li>
				</noscript>

The problem is that the value after _qs=_gv changes with each session.
Do you have any ideas how I could get this working? :S

The value I would need is in bold:

document.write('<li><a href="/oyster/journeyHistoryThrottle.do?_qs=_qv%3Dc2115ef6e2db4509db5d5f1b044f09009b4d3e30">Journey history</a></li>');
 
Never mind, found it! Sorry but a mod can close/delete this now :)

Solution:
$pattern = "/<a href=\"\/oyster\/journeyHistoryThrottle.do(.*?)\">Journey history/s";

edit: Thanks aharvey for the help
 
Back
Top Bottom