- AuthorPosts
- April 1, 2008 at 11:06 am #5627owilskyParticipant
I want the text between two commands/tags to be highlighted.
I want to highlight everything between two *FONT commands excluding the commands.
Example: *FONT 3text*FONT 0
here only “text” should be highlighted. The numbers 3 and 0 could be any number.I tried this with lookbehind and lookahead:
(?<=*FONT ?d+).*?(?=*FONT ?d+) Unfortunately lookbehind does not allow a regex but only text, so “(?<=*FONT ?d+)" does not work. Any ideas how this could be achived? Thanks!
April 1, 2008 at 5:03 pm #5630Yutaka EmuraKeymasterowilsky wrote:
I want the text between two commands/tags to be highlighted.I want to highlight everything between two *FONT commands excluding the commands.
Example: *FONT 3text*FONT 0
here only “text” should be highlighted. The numbers 3 and 0 could be any number.I tried this with lookbehind and lookahead:
(?<=*FONT ?d+).*?(?=*FONT ?d+)
Unfortunately lookbehind does not allow a regex but only text, so “(?<=*FONT ?d+)" does not work.
Any ideas how this could be achived?
Thanks!
Unfortunately, the regular expression engine does not support variable length of lookbehind and lookahead. You will need to have the expression fixed length in lookbehind and lookahead can be matched.
- AuthorPosts
- You must be logged in to reply to this topic.