Sure. What follows is a dumb example ( executed in https://regex101.com/ ), but illustrates my point.
In this particular case you could say that ? is semantically required for <script> because we could have more than one, but many times we don't have this distinction and it still affects how many steps the #regex has to perform.
(Sorry for having the text selected in the 2nd image, I was copying it for the alt of the images 😅 )
<main>
Hello World
<script>console.log("hello!"); More stuff Just a decoy!](https://media.hachyderm.io/media_attachments/files/111/914/833/409/432/020/original/3925f50f868f8a82.png)