mortenbo
mortenbo

Reputation: 69

Always catch the outermost delimiter?

In the two strings:

")}"
"})"

I have been trying to make a pcre regexp that will always capture the outermost of the two delimiters regardless of their order, so in the first string, it should capture '}' and in the second string, it should capture ')'. In the very simple

"(}|\))"

The innermost delimiter would always be captured. I want to capture the outermost of the two regardless of their order, because I want to find their matching delimiter '(' or '{' and this is determined by the outermost delimiter.

I would like to demonstrate that I had done more to solve the problem, but I don't really know where to start.

Upvotes: -1

Views: 34

Answers (0)

Related Questions