[EMAIL PROTECTED], 2001-03-25 15:14 -0800
>On Sun, 25 Mar 2001, Mike Noyes wrote:
>The g indicates multiple substitutions within the selected lines. My
>mistake wsa in the line selection.  I simplified things while testing
>the command, and forgot to constrain it to the author table when I sent
>that message.
>
>This version also handles quoting, I think.
>
>sed -e "/INSERT INTO
>author/s/\((\('\([^'\]\|\\\.\)*',\)\{4\}\)'\([^']*\)',\([^)]*\)/\1'dummy',\ 
>5/g"

I'll try it later tonight. I'm new to regular expressions. Is this the way 
the regions are split? I didn't know you could nest them.

\((
   \('                 # nested one level
     \([^'\]\|\\\.\)   # nested two levels
   *',\)               # nested one level
\{4\}\)
'\([^']*\)
',\([^)]*\)

This will take me a couple of hours to decipher.

>---------------------------------------------------------------------------
>sed -e "/INSERT INTO author/s/\((\('\([^'\]\|\\\.\)*',\)\{4\}\)'\([^'\]\|\\
>\.\)*',\([^)]*\)/\1'dummy',\5/g"
>---------------------------------------------------------------------------
>
>and the next one looks like it might work for users, but you should test
>it out.

I'll test it too. I'm getting a nice headache looking at these sed lines. ;)

>---------------------------------------------------------------------------
>sed -e "/INSERT INTO user/s/(\(\('\([^'\]\|\\\.\)*',\)\{6\}\)'\([^'\]\|\\\.
>\)*'\(,'\([^'\]\|\\\.\)*'\)\{11\}/\1'dummy',\5/g"
>---------------------------------------------------------------------------
>
> >
> > author
> > ('aid','name','url','email','pwd','counter')
> >
> > user
> > ('uid','name','uname','email','femail','url','pass','storynum','\
> > umode','uorder','thold','noscore','bio','ublockon','ublock','\
> > theme','commentmax','counter')
>
>are you sure that the pwd field in the author table is password and not
>present working directory?  Users have a "pass" field... which would
>appear to be inconsistent naming.

I noticed that it was inconsistent too. The password field for author is 
pwd. I just double checked to make sure. Thanks for all the help. :-)

--
Mike Noyes <[EMAIL PROTECTED]>
http://leaf.sourceforge.net/


_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to