1

I need regular expression that will retrieve strings between two pairs of {{ }}, non gridy, ignoring few special characters. For example :

The text: {{Lorem ((ipsum dolor [[sit amet]], consectetur)) adipiscing}}{{elit. ((Proin eget [[felis sit]] amet)) diam}}

Target: Will Match the following 2 matches:

  1. Lorem ipsum dolor sit amet, consectetur adipiscing
  2. elit. Proin eget felis sit amet diam

All the match should be without the partenless, brackets and the braces

4

1 回答 1

1

All the match should be without the partenless, brackets and the braces

Matches are substrings of the original string, you cannot have gaps in them, so what you're asking for is impossible.

You can match for the whole string, then filter out the unneeded characters in your favorite programming language...

{{.*?}}
于 2013-04-27T07:04:25.040 回答