title: How to arrange values in a hashmap if i want to filter out values inbetween open and close keywords
body: <p>I have Unique session id for which i want values to be populated and store them in a hashmap or similar data structures. But i want to filter the values between open and close
  for ex:
  <a href="https://i.stack.imgur.com/Q5eF4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q5eF4.jpg" alt="enter image description here"></a></p>
  
  <p>so i want the output as:<a href="https://i.stack.imgur.com/7ZJOX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7ZJOX.jpg" alt="enter image description here"></a>
  where 1 is the unique session followed by values between open and close</p>