RegEx Engine not working correctly?

General discussions about Advanced Find and Replace
Post Reply
kadunkadunk
Posts: 2
Joined: Mon Jun 01, 2009 6:48 pm

RegEx Engine not working correctly?

Post by kadunkadunk »

Source Text:
PCTFREE 10
INITRANS 1
STORAGE
(
INITIAL 80K
NEXT 1024K
MINEXTENTS 1
MAXEXTENTS UNLIMITED
)
TABLESPACE MCPPD_DATA
NOLOGGING
MONITORING
NOPARALLEL;

Match Pattern:
(PCTFREE.*)(TABLESPACE )([A-Z|_]*)([^;]*;)
Replace Pattern:
$2$3;

Expected Results:
TABLESPACE MCPPD_DATA;

I have the 'S' OPTION on. It is not picking up ([A-Z|_]*)([^;]*;).
Do you think this is a bug?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: RegEx Engine not working correctly?

Post by Abacre »

There are a lot of excessive places in your regular expressions.

Try the following simpler expression:
Search for:
PCTFREE.*(TABLESPACE \S+)\s+.*;
Replace with:
$1;
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

kadunkadunk
Posts: 2
Joined: Mon Jun 01, 2009 6:48 pm

Re: RegEx Engine not working correctly?

Post by kadunkadunk »

Thank you for your help and quick relpy. Your code worked. However, my code should work as well. I tried at least 20 combinations of metacharacters, all of which should have worked. I started out with an expression with only one capturing block, but the regex engine did not like that either. I only used the more basic character classes, i.e. [a-z|_], as a last resort to try and de-bug the regex engine. I still think there is a bug and a ticket should be opened.

Let me know what you think.

Thanks

Post Reply