V
Vidéotron
Hi,
A bit new to "more complex" expression... So here the case I have:
bla bla bla{TPL,some texte or numbers}bla bla bla.
I figured out how to write the expression to extract the "{TPL,some texte or
numbers}", wich is what I want to get using "/\{TPL,[^\{\}]\}/" wich to my
understanding mean anything that start with "{TPL," and end with "}". That
seem to be working fine.
The thing is that I have variation on the same thing that I also need to
extract. For exemple:
bla bla bla{TPL,alpha 1{alpha 2}alpha 3}bla bla bla.
Also, there could be any combination of no alpha 1 and/or no alpha 3, have
others "{alpha x}" included... What I really want to do it's to extract what
ever start with "{TPL," untile it's corresponding ending "}".
I have tried using the "|" to list some possibilities, giving stuff like
this:
/\{TPL,\{[^\{\}]\}|[^\{\}]\}/
But somehow it doesn't quite understand what I am trying to do. On some
occasion, the "closing" } was not included in the returning search. I have
also tried to put the 2 expression between square bracket and adding the *
operator to get to have multiple occurence, but that work even less.
So I figured out that my understanding of regular expression isn't up to
this challenge and I was windering if anyone could, at the very least point
me in the right direction, either to docs that would help me understand
regular expression or help me resolve this issue.
TIA
Eric Therrien
A bit new to "more complex" expression... So here the case I have:
bla bla bla{TPL,some texte or numbers}bla bla bla.
I figured out how to write the expression to extract the "{TPL,some texte or
numbers}", wich is what I want to get using "/\{TPL,[^\{\}]\}/" wich to my
understanding mean anything that start with "{TPL," and end with "}". That
seem to be working fine.
The thing is that I have variation on the same thing that I also need to
extract. For exemple:
bla bla bla{TPL,alpha 1{alpha 2}alpha 3}bla bla bla.
Also, there could be any combination of no alpha 1 and/or no alpha 3, have
others "{alpha x}" included... What I really want to do it's to extract what
ever start with "{TPL," untile it's corresponding ending "}".
I have tried using the "|" to list some possibilities, giving stuff like
this:
/\{TPL,\{[^\{\}]\}|[^\{\}]\}/
But somehow it doesn't quite understand what I am trying to do. On some
occasion, the "closing" } was not included in the returning search. I have
also tried to put the 2 expression between square bracket and adding the *
operator to get to have multiple occurence, but that work even less.
So I figured out that my understanding of regular expression isn't up to
this challenge and I was windering if anyone could, at the very least point
me in the right direction, either to docs that would help me understand
regular expression or help me resolve this issue.
TIA
Eric Therrien