Get Elements via using regular expressions in Arbortext Editor 6.1
Hi,
we would like to get all '<simpara>'-Elements within an array (as each entry), if the user marks some <simpara>s.
This is for example the marked selection:
<simpara role="klein">This is a test text<emphasis role="underlined">with emphasis elements</emphasis> inside simpara</simpara><simpara>Lorem ipsum</simpara><simpara>Test test test <emphasis role="italic_on">asdfasdf</emphasis>lol omg</simpara><simpara>Test text with footnote inside<footnote><simpara>footnote text</simpara></footnote>lorem lorem</simpara><simpara>Pun<emphasis role="bold_on">asdfasdf</emphasis>kt 6</simpara>
As you can see, in this example there are 5 <simpara>'s which we would like to get in an array like this:
$arr[0] = <simpara role="klein">This is a test text<emphasis role="underlined">with emphasis elements</emphasis> inside simpara</simpara>
$arr[1] = <simpara>Lorem ipsum</simpara>
$arr[2] = <simpara>Test test test <emphasis role="italic_on">asdfasdf</emphasis>lol omg</simpara>
$arr[3] = <simpara>Test text with footnote inside<footnote><simpara>footnote text</simpara></footnote>lorem lorem</simpara>
...
We tried to solve this with a while loop and "index" function to search for '<simpara>' and '</simpara>' to get each simpara, but unfortunately if there are footnotes inside (see red example above), which has also <simpara> inside, this try does not work, because the remaining text is cutted after </simpara>.
Our other try with regular expressions also does not work, although our regex seems to be correct (tested in regexlab):
$res = match($simparas,'<simpara.*?[^footnote>]</simpara>')
message_box($res,0)
We get no result if we use this acl. We think, the problem is the '?' (lookahead) command inside our regex. It seems to be, that 'lookahead' does not work in acl-regex?
Can anybody help us? Maybe some of you had the same request or another idea to get the desired result.
Thank you in advance.
Greetings from Germany

