To keep it simple, let's look at the following example:
iphone Foo.bar.StartTimestamp:[2012-11-12 TO 2016-02-15] and apple Bar.Foo.BarTimestamp:[2012-11-12 TO 2016-02-15] apple
from the text above, I would like to filter Foo.bar.StartTimestamp:[2012-11-12 TO 2016-02-15]and Bar.Foo.BarTimestamp:[2012-11-12 TO 2016-02-15]using regex. there may be any combinations instead Bar.Foo.BarTimestamp:[2012-11-12 TO 2016-02-15], but it will be in the same format.
I tried this regex (?<!\\S)[][^[]]*, but its only filtering text surrounded by square brackets.
How do I create a regular expression to get the desired result?
here is a link to regex101.com: https://www.regex101.com/r/QLP4jB/1
source
share