Reg expression as Pattern

Hello,

Can we define a regular expression as a pattern in ML training?

Thanks