# sed number between special characters

I need to get a number string from between two special strings.

String : Build : 76.x-20161016_x_567.0 <br> GRN : <a href="http://toolserver.lab.net:9080/jenkins/job/test_prj/20/changes">109960</a>

Need to get the number (here 109960) between ">" and "</a>" How can I use sed for this.?

• This is pretty straight forward. What did you try? – heemayl Oct 17 '16 at 12:02
• String is <description>Build : 76.x-20161016_x_567.0 <br> GRN : <a href="http://toolserver.lab.net:9080/jenkins/job/test_prj/20/changes"&gt;809960&lt;/a&gt;</description>and I tried sed -e 's/\&gt\;(.*)\&lt\;/\1/' but didnt help – tony Oct 17 '16 at 12:06
• Also your comment seems contradictory to your post in terms of what pattern is wrapping the number you want to extract: is it &gt;[NUMBER];/a&gt or >[number]</a> ? Please clarify and edit your post accordingly. – Valentin B. Oct 17 '16 at 14:14
$string='Build : 76.x-20161016_x_567.0 <br> GRN : <a href="http://toolserver.lab.net:9080/jenkins/job/test_prj/20/changes">109960</a>'$ echo $string | sed 's/^.*>$$[0-9]*$$<\/a>.*$/\1/'
`