Regular Expression in Formatter

There is an example of using built in features here Extract an ID using regex to split the text but you can’t use regex directly. That maybe possible with just running a custom javascript though?