2 added 162 characters in body
source | link
xml = { XMLElement[    "a", {
     "shape" -> "rect", 
     "id" -> "ctl00_CP1_gv_ctl03_hlSub", 
     "href" -> "/boards/read_msg.aspx?message_id=131676511"
   }, 
 {comment_}]
};

Cases[xml
  , XMLElement[_, {___, "href" -> (
        s_?(StringStartsQ["/boards/read_msg.aspx?message_id="])
      ), ___}, _
    ] :> s
  , ∞
]
{"/boards/read_msg.aspx?message_id=131676511"}

or:

Cases[xml, XMLElement[_,  KeyValuePattern[ 
  "href" -> (s_?(StringStartsQ["/boards/read_msg.aspx?message_id="]))
 ], _] :>   s, ∞
]
xml = { XMLElement[    "a", {
     "shape" -> "rect", 
     "id" -> "ctl00_CP1_gv_ctl03_hlSub", 
     "href" -> "/boards/read_msg.aspx?message_id=131676511"
   }, 
 {comment_}]
};

Cases[xml
  , XMLElement[_, {___, "href" -> (
        s_?(StringStartsQ["/boards/read_msg.aspx?message_id="])
      ), ___}, _
    ] :> s
  , ∞
]
{"/boards/read_msg.aspx?message_id=131676511"}
xml = { XMLElement[    "a", {
     "shape" -> "rect", 
     "id" -> "ctl00_CP1_gv_ctl03_hlSub", 
     "href" -> "/boards/read_msg.aspx?message_id=131676511"
   }, 
 {comment_}]
};

Cases[xml
  , XMLElement[_, {___, "href" -> (
        s_?(StringStartsQ["/boards/read_msg.aspx?message_id="])
      ), ___}, _
    ] :> s
  , ∞
]
{"/boards/read_msg.aspx?message_id=131676511"}

or:

Cases[xml, XMLElement[_,  KeyValuePattern[ 
  "href" -> (s_?(StringStartsQ["/boards/read_msg.aspx?message_id="]))
 ], _] :>   s, ∞
]
1
source | link

xml = { XMLElement[    "a", {
     "shape" -> "rect", 
     "id" -> "ctl00_CP1_gv_ctl03_hlSub", 
     "href" -> "/boards/read_msg.aspx?message_id=131676511"
   }, 
 {comment_}]
};

Cases[xml
  , XMLElement[_, {___, "href" -> (
        s_?(StringStartsQ["/boards/read_msg.aspx?message_id="])
      ), ___}, _
    ] :> s
  , ∞
]
{"/boards/read_msg.aspx?message_id=131676511"}