[oXygen-user] regular expression problem

Syd Bauman
Sun Nov 11 12:06:19 CST 2007


I've been able to duplicate this problem using the regular expression
posted, using oXygen 9 on Mac OS X, using the lyrics below. (Numbered
as if they were a basic program, as there are < 10 lines :-)

However, I'm not sure it's a bug. I think maybe the regexp is working
as advertised. The ".+" in the second parenthetical is greedy, and
should grab all but the last digit, I think. To make it non-greedy
use ".+?".

original:
> <l>(.+)(\d+)(</l>) 
> <l n="$2"> $1 ($2) $3

possible improved version:
  <l>(.+?)(\d+)(</l>) 
  <l n="$2"> $1 ($2) $3


> Strangely, from time to time only the first digit is being copied
> with the replace function, although all digits are being
> highlighted with the search function. 

Of course, all digits (actually, the entire <l> element) is being
highlighted with the search function, no?

Below
-----
      <lg type="test">
        <note>To the tune of Weber &amp; Rice's <title>Don't Cry for
        me Argentina</title></note>
        <l>Don't cry for me Charles Goldfarb, 10</l>
        <l>The truth is I do not miss them, 20</l>
        <l>All of those features, 30</l>
        <l>Because we're lazy, 40</l>
        <l>To save us typing, 50</l>
        <l>They drove us crazy. 60</l>
      </lg>




More information about the oXygen-user mailing list