Reputation: 3527
I need to write a regular expression to grab just the values from the articleid parameter. (ie. 2689615). I have a good start: [0-9]
but just don't know where to go from there. Basically, I need something to grab values between 'articleid='
and '">'
<strong>Name</strong>
<li><a href="detail.aspx?articleid=2689615">Id 1</a></li>
<li><a href="detail.aspx?articleid=2689723">Id 2</a></li>
<li><a href="detail.aspx?articleid=2689831">Id 3</a></li>
<li><a href="detail.aspx?articleid=2690137">Id 4</a></li>
<li><a href="detail.aspx?articleid=2690713">Id 5</a></li>
Upvotes: 1
Views: 85
Reputation: 995
Capture:
/articleid=([^\"]+)/
This captures everything between the equals and the double quote...
I always use: http://rubular.com/
Upvotes: 3
Reputation: 10067
If you know the parameter name and the value is just numbers:, this should work:
articleid=([0-9]+)
Upvotes: 0