Incorrect regular expression accepted by Oxygen

Having trouble installing Oxygen? Got a bug to report? Post it all here.
be_tnt
Posts: 2
Joined: Wed Apr 18, 2007 10:55 am

Incorrect regular expression accepted by Oxygen

Post by be_tnt »

Hi!

I have just notice that one of my regular expression (used with pattern) was incorrect. I would expect to get an error from Oxygen (or at least from the XML Schame Regular Expressions Builder).

My pattern was the following:

Code: Select all

((([^0][1]?[0-9]{0,2}|2([0-4]?[0-9]{0,1}|5[0-5]?))\.){0,3})(([^0][1]?[0-9]{0,2}|2([0-4]?[0-9]?|5[0-5]?)))/(3[0-2]|[1-2]?[0-9]))
In another view:

Code: Select all

(
(
(
[^0][1]?[0-9]{0,2}
|2
(
[0-4]?[0-9]{0,1}
|5[0-5]?
)
)\.
){0,3}
)
(
(
[^0][1]?[0-9]{0,2}
|2
(
[0-4]?[0-9]?
|5[0-5]?
)
)
)/
(
3[0-2]
|[1-2]?[0-9]
)
)
You can see that I have on ( in more. Is it normal that I did not get an error?
I heard that the XMLSpy software raised an error message for that. Why not Oxygen? I am using version 7.2

Thx in advance for your answer.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The last character, that is '(' is not matched by a previous ')' character. It is not useful in the expression and the regular expression can be parsed so it is ignored instead of reporting an error.


Regards,
Sorin
be_tnt
Posts: 2
Joined: Wed Apr 18, 2007 10:55 am

Post by be_tnt »

Not sure to understqand your point, Sorin.
You meant that the last ')' is ignored because there is not a corresponding '(', right?
Should not Oxygen generate a Warning, at least? As I said XMLSpy generates an error becuase of the missing '('.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

We will consider generating a warning for characters that are added at the end of an expression that can be parsed without error and that do not change the expression.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re:

Post by sorin_ristache »

Hello,
be_tnt wrote:You meant that the last ')' is ignored because there is not a corresponding '(', right?
Should not Oxygen generate a Warning, at least?
I just wanted to let you know that the error checking in regexp patterns entered in the Schema Regexp Builder tool is more strict now. In your case it marks the ')' character in the regular expression when you click on the error label in the regexp builder dialog. You can try the new error checking starting with version 10.


Regards,
Sorin
Post Reply