I program perl for a while now and still suck at regexes.
My file looks like:
I read following link: "How do I extract all text between two keywords like start and end?". But it didn't make me any wiser.STARTP TITLE some gibberish some more gibberish ENDTITLE TITLE some gibberish some more gibberish ENDTITLE TITLE some gibberish some more gibberish ENDTITLE ENDP STARTP TITLE some gibberish some more gibberish ENDTITLE TITLE some gibberish some more gibberish ENDTITLE TITLE some gibberish some more gibberish ENDTITLE ENDP
I want to get everyting from STARTP until ENDP. En then cut stuff up between TITLE and ENDTITLE. But if I do like the suggested link I get everything fron first STARTP until last ENNDP. And I want to match first from First STARTP until first ENDP in the file and then from next STARTP until next ENDP. And the same for TITLE and ENDTITLE.
And no there is no recursion in these tags.
thanx
janitored by ybiC: Retitle from one-word "regex" nodetitle to avoid hindering site searching. Also converted node link from <a href...> to Monastery style [id://nnnn] to avoid logging out monks with cookie set from different PM domain (perlmonks.(org|net), sans leading "www"...)
In reply to Regex for simple parsing job by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |