I'm currently having some trouble wrapping my head around regular expressions, which is where I hope some of you regex guru's out there might be able to assist with.
I'll briefly explain my problem with an example of what I am trying to achieve. I have an input string, with a key and开发者_开发百科 value I am looking for, which look somewhat like this:
- G01::Notice ((The customer already exists))
- G01::MyNotice ((The customer already exists, nevermind...))
- G02::OrderConfirm ((The order has been comfirmed! Please inform the customer that his orders will arrive soon.))
In the above examples, I would like to get everything for G01:: which is enclosed within the parentheses. So my pattern is
Looking at the three input strings, I should add a few notices:
I am not sure if your question is complete ...
Is it this what you want?
G01::[^(]*\(\(([^)]*)
See it here on Regexr. The text within the brackets is in the capture group 1.
Try this regex: G01::\w+ \(\((.*?)\)\)
Not a complete question, but how about this one?
.*\((.*?)\)
Result 1
The customer already exists
Result 2
The customer already exists, nevermind...
Result 3
The order has been comfirmed! Please inform the customer that his orders will arrive soon.
On rubular
G01.*\(\((.*)\)\)
seems to work (unless I misunderstood your question).
精彩评论