I am very new in regex topic. I want to parse log files with following regex:
(?(.*?))[|](?(.*?))[|](?(.*?))[|]
Your regex can be optimized to:
(?([^|]*))[|](?([^|]*))[|](?([^|]*))[|](?[1-3])[|](?([^|]*))[|]{3}(?([^|]*))[|][|](?([^|]*))[|](?([^|]*))
using negated char class instead of lazy quantifiers. It reduce backtrack. Regex101 went from 316 steps to 47 with this change. Combine it with RB.'s answer and you should be fine