473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1439
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: McKirahan | last post by:
How would I use a regular expression to remove all trailing Carriage Returns and Line Feeds (%0D%0A) from a textarea's value? Thanks in advance. Also, are they any great references for learning...
20
by: RobG | last post by:
I'm messing with getPropertyValue (Mozilla et al) and currentStyle (IE) and have a general function (slightly modified from one originally posted by Steve van Dongen) for getting style properties:...
4
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
13
by: Phat G5 (G3) | last post by:
I am weak when it comes to regexp but hoped someone might know in this case. I am trying to take a url like this : something.lasso?blah=blah&blah2=blah2&sort=hello&blah3=blah3 And remove the...
6
by: jiing24 | last post by:
I try to use regexp to replace some html tags in DOM, but the result seems some problems, ================================ <Script language="javascript" type="text/javascript"> var config =...
7
by: Csaba Gabor | last post by:
I need to come up with a function function regExpPos (text, re, parenNum) { ... } that will return the position within text of RegExp.$parenNum if there is a match, and -1 otherwise. For...
8
by: reflex | last post by:
Hi, i have script with pattern (href=?(.*)({1}+)?), where i match any occurence of url and replace hyperlink so i have only anchor in it. var regExp = /href=?(.*)({1}+)?/ig; var wholeContent...
2
by: X l e c t r i c | last post by:
Here: http://bigbangfodder.fileave.com/res/sandr.html I'm trying to use string.replace() for a basic search and replace form using textarea values as the regexp and replacement values for...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.