1
I want to make a dynamic list that uses the Regex.Split
separating each item by the character of a new line, except when you’re in the fields ( ... ) in my lines of code, as follows the example:
var x = 'the quick fox jumps over the lazy dog'
var n = 'myChar (string:substring, x, 3) !!!'
writeLn 'first value = $x, final = $n'
if $n = $null (
#aqui está o erro
#ele da split aqui
writeLn 'error'
)
#e assim por diante...
I want all lines separated by new lines, for example what I want to:
ind. valor do elemento
------- -------------------------------------------------
0 var x = 'the quick fox jumps over the lazy dog'
1 var n = 'myChar (string:substring, x, 3) !!!'
2 writeLn 'first value = $x, final = $n'
3 if $n = $null (
#aqui está o erro
#ele da split aqui
writeLn 'error'
)
4 #e assim por diante...
But this is returning:
ind. valor do elemento
------- -------------------------------------------------
0 var x = 'the quick fox jumps over the lazy dog'
1 var n = 'myChar (string:substring, x, 3) !!!'
2 writeLn 'first value = $x, final = $n'
3 if $n = $null (
4 #aqui está o erro
5 #ele da split aqui
6 writeLn 'error'
7 )
#e assim por diante...
Below is an image to better describe what is detected:
This is the Regex I’m wearing: (?!.*('|\(|\)))\n
I accept answers in Regex, or VB.NET / C# (VB preference)
A hint would be to remove comments that are not suitable for execution. Replace (#.)(\n) by "", then you pass your regex. What do you think?
– user6406
From what I understand by looking at your example of what’s right, you’re looking to make a parser. It’s something far more complex than you think and I think it’s unlikely that someone will give you some just with this reward. And if I understood his ultimate goal, the parser is even better because you will have a lot of problems of this type. The description of the problem does not match much with the example.
– Maniero
has to post part of the code to understand better?
– Dorathoto