How to get the contents of the condition of the JOIN clause

0

I have the following situation that can be seen in this link .

The expression is:

/((^|\s)(right|inner|left)\sjoin\s(.*?)on\s(.*?)(?=(inner|right|where)?))+/gmi

I need to get the conditions that are within on , plus the other information that is already being captured.

Does anyone have a tip?

    
asked by anonymous 09.04.2014 / 14:36

1 answer

1

I do not know the source of your expression (let alone if the result was really the intended one) but I adapted it to get the values preceded by on .

Then try this :

^(?<expressaocompleta>(?:^|\s)(?<tipojoin>right|inner|left)\sjoin\s(?<tabelasjoin>.*)\son\s(?<clausulas>.*(?<fatorcondicional>inner|right|where(?<condicao>.*))?))$

It's a little big, but I've commented on it to get a bit more intuitive

    
16.04.2014 / 03:13