Regular expression to fetch username= 'testuserMM' from the string <p>I tried this regex to capture username </p> <pre><code>highs\(\d+\)\[.*?\]\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]\sftid\(\d+\):\s. </code></pre> <p>It didn't work. </p> <pre><code>&lt;55&gt;Mar 17 12:02:00 forcesss-off [Father][1x91422234][eee][hote] abcd(QlidcxpOulqsf): highs(23455814)[mothers][192.192.21.12] ftid(64322816): oops authentication failed with (http-commo-auth, username='testuserMM' password='********'congratulation-fakem='login' ) </code></pre>