Hi Jackky,
After checking this issue, I found that it's probably the browser issue. The pattern regex is outputted correctly in the input, but the browser displays it as rendered entities.
When you view the source code of the page, you'll see the pattern attribute is outputted correctly. But when you *inspect* the input with the browser inspector, it will shows rendered entities. So, it seems to be an issue with viewing in the browser instead of a technical issue, which probably can't be fixed.
I created a demo with pure HTML for you to check here.