Bug in Find Code Using Regular Expressions

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sarcanon
Posts: 45
Joined: Mon Aug 24, 2009 11:42 pm

Bug in Find Code Using Regular Expressions

Post by sarcanon »

Hello.

I am using Oxygen XML Editor 10.3 (build 2009062616) on Windows XP (SP3). I am trying to do some find/replace operations using regular expressions, and have come across some behavior that seems to me to be a bug.

Using the following chunk of XML:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<item>omnium doctrīnārum inventrīcēs Athēnās <bibl>(<ref cRef="De Or. i. 13"><ref target="#bibl-CIC-DEOR">De Or.</ref> i. 13</ref>),</bibl> Athens, discoverer of all learning.</item>
Attempt to do a Find (using regex) with the following pattern:

Code: Select all

(</bibl>*?)([\w\W]*?)(</item>*?)
Notice how the final angle bracket in the closing </item> tag is omitted from the found text. This seems to me a bug.

Thank you.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Bug in Find Code Using Regular Expressions

Post by sorin_ristache »

Hello,

The matched string in the Oxygen editor panel is correct according to your regular expression. Your expression ends with a non-greedy match for an optional character '>', that means no '>'. That is why the '>' is not highlighted in the editor. I am not sure what you are trying to match but I guess you want to end your regular expression with ((</item>)*?) or with ((</item>)+?) .


Regards,
Sorin
sarcanon
Posts: 45
Joined: Mon Aug 24, 2009 11:42 pm

Re: Bug in Find Code Using Regular Expressions

Post by sarcanon »

Interesting. I created my original pattern in another application where it captured the trailing bracket.

In any event, thank you for the solution to my issue.

Cheers.
Post Reply