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

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