I'm configing a RegEx (so it won't be that easy to switch into raw code for this requirement), to get the last line of input, if I use `/.*$/` it gets quite slow for some inputs, e.g. js`'1'.repeat(1e6)+'\n2'`. Is there fast way to get the last line? 

Also, if it's not a good idea to use RegEx as a matching config, is there better suggestions?