これを試して:
(?:<(em|b)[^<>]*?>)([^<>]+)(?=</\1>)
説明:
<!--
(?:<(em|b)[^<>]*?>)([^<>]+)(?=</\1>)
Options: case insensitive; ^ and $ match at line breaks
Match the regular expression below «(?:<(em|b)[^<>]*?>)»
Match the character “<” literally «<»
Match the regular expression below and capture its match into backreference number 1 «(em|b)»
Match either the regular expression below (attempting the next alternative only if this one fails) «em»
Match the characters “em” literally «em»
Or match regular expression number 2 below (the entire group fails if this one fails to match) «b»
Match the character “b” literally «b»
Match a single character NOT present in the list “<>” «[^<>]*?»
Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
Match the character “>” literally «>»
Match the regular expression below and capture its match into backreference number 2 «([^<>]+)»
Match a single character NOT present in the list “<>” «[^<>]+»
Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
Assert that the regex below can be matched, starting at this position (positive lookahead) «(?=</\1>)»
Match the characters “</” literally «</»
Match the same text as most recently matched by capturing group number 1 «\1»
Match the character “>” literally «>»
-->
このパターンは、タグ付けされたデータ全体を開始と終了のペアと一致させるためのものです。
ただし、タグのみを削除したい場合は、次を使用できます。
</?(em|b)[^<>]*?>