468,253 Members | 1,228 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,253 developers. It's quick & easy.

RegExp.replace freezing

Hi,
I am trying to write a regexp to find all the code on the header of
entities in SQL Server (views, SPs, etc...) I got something like
this:

(.|\n)*((create view)|(create proc)|(create function)|(create
trigger))
does that means sense? I want all the code that's before the code
header. now, the problem is, when i give that pattern with some
string
buffer to the 'replace' method (I replace it with String.Empty...
meaning i want to remove the header) the whole enviroment just
freezes... the RegExp.Replace method never returns...
anybody has any idea why? or some different regexp that does the same
that may not hit that bug? (i assume its a bug) i am using .net 2.0
thanks
Jonathan

May 8 '07 #1
3 1245
On May 8, 2:19 pm, y...@nobhillsoft.com wrote:
Hi,
I am trying to write a regexp to find all the code on the header of
entities in SQL Server (views, SPs, etc...) I got something like
this:

(.|\n)*((create view)|(create proc)|(create function)|(create
trigger))

does that means sense? I want all the code that's before the code
header. now, the problem is, when i give that pattern with some
string
buffer to the 'replace' method (I replace it with String.Empty...
meaning i want to remove the header) the whole enviroment just
freezes... the RegExp.Replace method never returns...

anybody has any idea why? or some different regexp that does the same
that may not hit that bug? (i assume its a bug) i am using .net 2.0

thanks
Jonathan
Can you replace with other patterns? Can you replace with something
other than String.Empty? Does the environment ever return?

Thanks,

Seth Rowe

May 8 '07 #2
Hey,
well, what i did is broke down all the 'or' into many different
expressions and then it does work... must be some bug in the
regexp .net code, it seems...

thanks for your help

May 13 '07 #3
yo**@nobhillsoft.com wrote:
Hey,
well, what i did is broke down all the 'or' into many different
expressions and then it does work... must be some bug in the
regexp .net code, it seems...
Maybe you created a pathological regular expression w.r.t. the regex
algorithm in the .NET framework.

http://swtch.com/~rsc/regexp/regexp1.html

Andrew
May 15 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by McKirahan | last post: by
20 posts views Thread by RobG | last post: by
13 posts views Thread by Phat G5 (G3) | last post: by
7 posts views Thread by Csaba Gabor | last post: by
8 posts views Thread by reflex | last post: by
2 posts views Thread by X l e c t r i c | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.