I have problem with enriching the expression. I'd like to make it much more complex:
Code: Select all
some text is here ble bla blu
some text is here ble bla blu
START
some text is here ble bla blu
* here i ignore the text
now there is some structure
struc something
now we are inside and next element:
elem value
something els, and again
elem val2
* elem ignored
end struc
this is not inside
* struc sth
* but it was ignored
elem valXXX
*end struc
I take only the thing that appear after the START element. So, if there is struc before, it must be ignored.
Next to it, all lines that start with * should be ignored.
The expected output is the same as last time.
I tried with ^ and $, but couldn't make it working with lookaheads. Can you show the solution in one reg exp? If not, can you split it to two but still only using reg exp (without any pre- or post-processing of the text).
@prometheuzz
Yes, i created some more posts on different forums. I did it because i am interested in any possible solution to the problem. Maybe someone could present something more complex but without lookahead (or only with the positive/negative). The problem here is quite serious - it is on the border of the reg exp possibilities. However, it is still possible to create the finite-states automaton for the problem, so the solution in reg exp must exist.
Then I'll wait until you get access to PHP and have tried a couple of things yourself.
Good luck.
I had problems with php server on my PC with Windows and i didn't have the possibility to connect to any server with php at that certain time.