I'm creating a templating system that can allow a user to create a template and use the selected/dynamic value from the original string.
Example:
Original string:
Lorem ipsum dolor (Hello world) sit YEAH amet
Template:
consectetur adipiscing elit, sed do @BETWEEN("dolor (",") sit") eiusmod tempor incididunt ut labore et dolore @BEWTEEN("sit","amet")
Output:
consectetur adipiscing elit, sed do Hello world eiusmod tempor incididunt ut labore et dolore YEAH
I'm trying to get the @BETWEEN from the template by using regex
@BETWEEN\([^\(\)]+\)
But it did not work due to the bracket symbol in the @BETWEEN bracket. I'm not very good at regex. Can anyone give me suggestion on how to enhance the regex or any other method to get the @BETWEEN function from the template