Cases[] with Pattern in Pattern

I often encounter this obstacle.

When I extract data from an URL, and I wish, for instance, to do it like this:

Cases[url, {XMLElement[
    "th", {___}, {_, XMLElement["span", {___}, {mo_}], _}], __, 
   XMLElement["td", {___, "id" -> XXX}, {E_}], ___} :> {mo, 
   E}, \[Infinity]]

but, instead of “XXX” I would like to say any string which ends with “priorSettle”.

Is it possible? or “XXX” can only be the exact string?

Out of my head (can’t really test it)
define a new function:

endsonpriorsettleQ[x_String] := StringMatch[x,___~~"priorSettle"]

Then replace XXX by:

_?endsonpriorsettleQ

worked beautifully!! especially after putting a Q after StringMatch :slight_smile:

Thank you!