Match a regex against the text before the cursor on the current line. Returns the match result or null.