-1

How to match anything between {esbmsg:header: and }

like xxxxxx could be any string {esbmsg:header:xxxxxx}

4

3 回答 3

2

Try with:

{esbmsg:header:([^}]*)}

Where [^}]* matches everything that is not } character.

于 2013-09-26T09:30:55.317 回答
0

Try this regex

{esbmsg:header:(.*)}

It will also allow you to have any character in value.

于 2013-09-26T09:34:42.920 回答
0

Well, if you want to capture only the content of your expression (the "xxxxx" part) the best approach is to use positive look ahead:

(?<={esbmsg:header:)[^}]+

Depending on how your content looks you might have to tweak the [^}] part. For further information on regex (or a detailed explanation of the expression above) I recommend the following:

Regex reference

Regex tutorial

于 2013-09-26T09:41:43.123 回答