I need a regex to find all matches for my pattern.
The text is something like this:
"someother text !style_delete [company code : 43ev4] between text !style_delete [organiztion : 0asj9] end of line text"
And I would like to find all matches for the pattern:
!style_delete [.*]
I have tried like this:
Pattern pattern = Pattern.compile("!style_delete\\s*\\[.*\\]");
With this the match text is coming like this:
!style_delete [company code : 43ev4] between text !style_delete [organiztion : 0asj9]
But I am expected as follows:
match 1 : !style_delete [company code : 43ev4]
match 2 : !style_delete [organiztion : 0asj9]
Please help me, what will the regex in java to get above output.