how do replace multi-line to null

how do replace multi-line to null

3
NewbieNewbie
3

    May 29, 2006#1

    I wanna replace the following text as "nrmuser".gi_interface_s cmdbs04,only keep part of the first line and part of the last line.
    but the following regular expression cann't find anything.
    create table(.*)\p(.*\p)*.*cmdbs04

    what's wrong with the expression?thanks a lot for your help.


    create table "nrmuser".gi_interface_s
    (
    serial_id integer not null ,
    int_id integer not null ,
    port_no integer not null ,
    ip_addr varchar(32),
    ethernet_mode varchar(64),
    timestamp datetime year to second,
    first_result datetime year to second not null ,
    compress_date date not null ,
    s_month smallint not null ,
    unique (compress_date,int_id,port_no) ,
    unique (compress_date,serial_id)
    )
    fragment by expression
    (s_month = 1 ) in cmdbs01 ,
    (s_month = 2 ) in cmdbs02 ,
    (s_month = 3 ) in cmdbs03 ,
    (s_month = 4 ) in cmdbs04 ,

    6,675585
    Grand MasterGrand Master
    6,675585

      May 29, 2006#2

      I don't have much knowledge about Perl regex. But I think, \p is not allowed for Perl compatible regex. You have to use \r\n instead of \p.

      However, it is nevertheless not working because the search string create table(.*)\r\n(.*\r\n)*.*cmdbs04 finds/selects the correct block but with the replace string \1cmdbs04 only the "create table" and the characters in the line with "cmdbs04" are removed. Don't know why.

      But this macro works without any regex search or replace:

      InsertMode
      ColumnModeOff
      HexOff
      Loop
      Find "create table "
      IfNotFound
      ExitLoop
      EndIf
      Delete
      Key END
      StartSelect
      Find Select "cmdbs04"
      EndSelect
      Delete
      "cmdbs04"
      EndLoop
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        May 30, 2006#3

        thanks Mofi. the Macro did work. :-)