I wanted to match the data in between "@@@"
characters
@@@haha@@@hoho@@@hehe@@@hihi@@@
regex:
@@@(.*?)@@@
By using this regex, I am only able to get haha
and hehe
, which are the 1st and 3rd matches. How to match all the 4 data in between @@@
?
Use look ahead to avoid that you grab the characters that you might still need to see in a next match:
@@@(.*?)(?=@@@)