CORS plugin: how does it know if it's a string or a regex?

The documentation for the CORS plugin’s parameter says:

The accepted values can either be flat strings or PCRE regexes.

How does Kong know if the value is a flat string or a regex?


For other people who have the same question, I found this topic explaining how this works.