... AA BB sysodufsoufdds BB AA ...
Where AA
,BB
can be arbitary consecutive string with no space in it.
But I want to get the outest pair:AA
More examples:
Input:
a HH CC abc CC HH c
Output:
HH
Input:
x YYYY j DD GG DD hsu DD GG DD k YYYY o
Output:
YYYY
To make my question more general,how to match a specific tag in html with regular expression?I've seen various posts discussing about this,but none of them give a answer by regex.Related questions are: http://stackoverflow.com/questions/116403/im-looking-for-a-regular-expression-to-remove-a-given-xhtml-tag-from-a-string