473,406 Members | 2,956 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,406 software developers and data experts.

Regular Expression question

I'm trying to work out a reg.exp. that will pick out a sql statement against
a certain set of tables - in this case any table named "Survey~something~",
but I only want to pull back those statements where the CompanyID column
doesn't appear in the query. (The expression is being used in my editor so
it might appear a little strange, but by and large it works the same as
you'd expect.)

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}

What do I need to add so that I get those without a companyid column?
Something like...

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}(^companyid)

(tried this one, but it doesn't work)

Thanks!

- Wm
--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri

Jul 19 '05 #1
3 1211
William Morris wrote on 18 jun 2004 in
microsoft.public.inetserver.asp.general:
I'm trying to work out a reg.exp. that will pick out a sql statement
against a certain set of tables - in this case any table named
"Survey~something~", but I only want to pull back those statements
where the CompanyID column doesn't appear in the query. (The
expression is being used in my editor so it might appear a little
strange, but by and large it works the same as you'd expect.)

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}

What do I need to add so that I get those without a companyid column?
Something like...

[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}(^compa
nyid)

(tried this one, but it doesn't work)


It should not. (^companyid) id not a correct negative lookahead
Should be (?!pattern) in jscript/vbscript.

However you are talking about an anonymous editor's regex (editpad?).

So what is the connection with ASP ???????????

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #2
[^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}(^compa
nyid)

(tried this one, but it doesn't work)

It should not. (^companyid) id not a correct negative lookahead
Should be (?!pattern) in jscript/vbscript.

However you are talking about an anonymous editor's regex (editpad?).


Homesite, actually.
So what is the connection with ASP ???????????


About three dozen queries in several ASP pages. Generally speaking, a
little off topic but I figured there would be a few people that might have
an answer.

Jul 19 '05 #3
William Morris wrote on 18 jun 2004 in
microsoft.public.inetserver.asp.general:
> [^']select(.){0,100}from(.){0,100}Survey(.){0,25}where (.){0,200}(^co
> mpa nyid)
>
> (tried this one, but it doesn't work)
>


It should not. (^companyid) id not a correct negative lookahead
Should be (?!pattern) in jscript/vbscript.

However you are talking about an anonymous editor's regex (editpad?).


Homesite, actually.
So what is the connection with ASP ???????????


About three dozen queries in several ASP pages. Generally speaking, a
little off topic but I figured there would be a few people that might
have an answer.


The problem is, that the regex specs are unknown.

In Jscript, I would first isolate the sql strings in an regex-match
collection and then regex-test those individually on the absence of the
word "companyid"

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject)...
5
by: Bradley Plett | last post by:
I'm hopeless at regular expressions (I just don't use them often enough to gain/maintain knowledge), but I need one now and am looking for help. I need to parse through a document to find a URL,...
10
by: Lee Kuhn | last post by:
I am trying the create a regular expression that will essentially match characters in the middle of a fixed-length string. The string may be any characters, but will always be the same length. In...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
5
by: Ryan | last post by:
HELLO I am using the following MICROSOFT SUGGESTED (somewhere on msdn) regular expression to validate email addresses however I understand that the RFP allows for "+" symbols in the email address...
7
by: norton | last post by:
Hello, Does any one know how to extact the following text into 4 different groups(namely Date, Artist, Album and Quality)? - Artist - Album Artist - Album - Artist - Album - Artist -...
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
6
by: Ludwig | last post by:
Hi, i'm using the regular expression \b\w to find the beginning of a word, in my C# application. If the word is 'public', for example, it works. However, if the word is '<public', it does not...
3
by: Zach | last post by:
Hello, Please forgive if this is not the most appropriate newsgroup for this question. Unfortunately I didn't find a newsgroup specific to regular expressions. I have the following regular...
25
by: Mike | last post by:
I have a regular expression (^(.+)(?=\s*).*\1 ) that results in matches. I would like to get what the actual regular expression is. In other words, when I apply ^(.+)(?=\s*).*\1 to " HEART...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.