Re: regex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You'd need to use a "look-ahead" or "look-behind" with PCRE to do this.

Search for a thread just last week involving quotes and HTML
attributes for an example.

PS
You could probably get the DB to ignore case in table names and table
fields with some kind of "set".

You also could probably just replace the [ and ] with " and keep table
names with spaces (ugh!) if all else fails.

On Mon, January 21, 2008 3:02 am, Peter wrote:
> I am trying to convert ms access sql to postgresql using php.
>
> I have a sql statement in the form ;-
> $sql = SELECT DISTINCT [Table Name].[Column.Name], [Table Name
> 1].[Column
> Name 2] etc.
>
> what I want to end up with is $sql = SELECT DISTINCT
> table_name.column_name,
> table_name_1.column_name_2, ........
>
> I have managed to get the caps to lower but I cant work out how to put
> the _
> in place of spaces if the spaces are between [  ].   I either end up
> with
> S_E_L_E_C ..... or SELECT_DISTINCT_ etc... .
>
> Naturally I have only used part of sql statement and table, column
> names
> have been changed. (Think the one I'm trying on is 2000+ characters.
> So its
> not a case of set number of words/numbers between [] it could be 2 or
> it
> could be 4 etc)
>
> Anyone workout what I am talking about and can help would be
> appreciated.
>
> Peter
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux