I have a string as Failed to acquire capacity on the hall
And sometimes I might also get Failed to acquire new capacity on the hall.
So to cover both the cases I want to make new as optional.
So I grouped new with ? as (new)? in the pattern as below
pattern : failed to acquire (new)? capacity.
But its not working as expected, i.e matching Failed to acquire capacity on the hall even though new is there or not. Ref: https://regex101.com/r/2YhjKc/1
What is the mistake I am doing here ?
Thank you.
new. Include the space or remove it:failed to acquire (new )? capacity