How to use regular expression comments

when learning the annotation capabilities of regular expressions, comments always cause matching exceptions. For example,

use

\d{2} 

match 24 can be successful. If you add a comment, it becomes

\d{2}(?-sharp)

match 24 fails.
after looking up a lot of information, I can"t find an explanation. Please give me some guidance. Thank you very much!


which language do you use, and then ask yourself two questions: are you sure annotations are supported? Are you sure Chinese annotations are supported?

Menu