Regular Expression question

Discussion in 'ASP General' started by William Morris, Jun 18, 2004.

  1. 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
     
    William Morris, Jun 18, 2004
    #1
    1. Advertising

  2. William Morris

    Evertjan. Guest

    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)
     
    Evertjan., Jun 18, 2004
    #2
    1. Advertising


  3. > > [^']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.
     
    William Morris, Jun 18, 2004
    #3
  4. William Morris

    Evertjan. Guest

    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)
     
    Evertjan., Jun 18, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Munn

    Regular expression question...

    Andrew Munn, Jun 29, 2003, in forum: Perl
    Replies:
    1
    Views:
    2,173
    rakesh sharma
    Jun 30, 2003
  2. Glenn Kidd

    Regular expression question

    Glenn Kidd, Aug 18, 2003, in forum: Perl
    Replies:
    0
    Views:
    947
    Glenn Kidd
    Aug 18, 2003
  3. VSK
    Replies:
    2
    Views:
    2,379
  4. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    881
    Alan Moore
    Dec 2, 2005
  5. GIMME
    Replies:
    3
    Views:
    12,046
    vforvikash
    Dec 29, 2008
Loading...

Share This Page