John Rambo
John Rambo

Reputation: 934

Regex not working with curly brace

I am trying to match the following pattern:

Testcase done, result: {error,
                           {test_case_failed,
                               "Fail: Not all values are as close to expected values."}}

Here, I am using the following regex to match the above pattern:

Testcase\s+done,\s+result:\s+\{(.*?)\}

However, my pattern is not working.

Upvotes: 0

Views: 291

Answers (2)

dpanshu
dpanshu

Reputation: 463

It's simple, as I can see you line can either start with Testcase or a blank space and brace' {' or blank space and quote ' {'

Regex:
Testcase.*|\ {.*| ".*

Check Here

Upvotes: 0

Tyress
Tyress

Reputation: 3653

Use this instead

Testcase\s+done,\s+result:\s+\{([\s\S]*?)\}

More info about the . (dot) character

Upvotes: 2

Related Questions