Page 1 of 1

XML tags for multiple lines

Posted: Fri Sep 10, 2004 1:37 am
by pieter
I have asked this before directly to Simon, but the answer has disappeared in Cyberspace. Probably it is better to post it here in the interest of the general public. My problem is the following. I have an input file like:
References:
Author1, title1.
Author2, title2.
...
Author_n, title_n.
<empty line>
This needs to be tagged in XML like
<reference>Author1, title1.</reference>
<reference>Author2, title2.</reference>
<reference>...reference>
<reference>Author_n, title_n.</reference>

How do I grasp this repetition of lines in a regular expression if I do not know beforehand how many lines I may expect after the first line with 'References:' Or do I need to write some VB?

thanks
Pieter Zanstra

Posted: Fri Sep 10, 2004 5:16 pm
by DataMystic Support
Hi Pieter,

Try EasyPattern

[ capture(csvfield), ',' , capture(csvfield) ]

Replace with

<reference>$1, $2</reference>

Or just add a new left/right margin.