I think I understand the rest of Colorers RegEx but this one I have not been able to figure out: "~ Matches for the start of parent scheme (end of <start> tag)."
Is there a good example or other description available to help me understand, as it seems useful if I only understood how to use it :-)
jonib
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Its difficult to give you a simple example, just because the usecase is difficult and rare.
Lets say you have scheme A, limited with REs /as/ and /ae/, and then within its context you have nested scheme B with REs /bs/ and /be/.
In normal conditions it'll work on a text like this:
===========
as
A's content: anything anything
bs
B's content: anything anything
be
continue with A: anything anything.
ae
===========
In cause you'll use /~be/, ~ will only match the only exact position after "as" lexem ("start of parent scheme"). So the only text structure it'll match is:
===========
asbs
B's content: anything anything
be
continue with A: anything anything.
ae
===========
Technically this ~ operator allows you to build constructs like:
/re1/ scheme1 /re2/ scheme2 /re3/
As far as I remember it is used in some XML and perl complex cases (although it could be simulated with other operators).
Hope this explanation helps you ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I think I understand the rest of Colorers RegEx but this one I have not been able to figure out: "~ Matches for the start of parent scheme (end of <start> tag)."
Is there a good example or other description available to help me understand, as it seems useful if I only understood how to use it :-)
jonib
Its difficult to give you a simple example, just because the usecase is difficult and rare.
Lets say you have scheme A, limited with REs /as/ and /ae/, and then within its context you have nested scheme B with REs /bs/ and /be/.
In normal conditions it'll work on a text like this:
===========
as
A's content: anything anything
bs
B's content: anything anything
be
continue with A: anything anything.
ae
===========
In cause you'll use /~be/, ~ will only match the only exact position after "as" lexem ("start of parent scheme"). So the only text structure it'll match is:
===========
asbs
B's content: anything anything
be
continue with A: anything anything.
ae
===========
Technically this ~ operator allows you to build constructs like:
/re1/ scheme1 /re2/ scheme2 /re3/
As far as I remember it is used in some XML and perl complex cases (although it could be simulated with other operators).
Hope this explanation helps you ;)
Thanks, It took a while but I think I understand and it seems to be the solution to a problem I'm having.
I need to use <block> with a scheme to match a string as a parameter to a function
Example:
Functionname("string")
The problem was that also this was shown as correct
Example2:
Functionname("string" "string" "string")
But using the tilde I can show an error if there is more then one string.
At lest it seems to work that way.
jonib