Tapatalk

Replacing to the end of a line

Replacing to the end of a line

5
NewbieNewbie
5

    Dec 07, 2006#1

    I am wondering if I had a line:

    &sid97807080779
    &sid75646567676
    &sid57657956bfshhf

    and I wanted to remove everything after &sid, how would I do this with the find and replace feature with regular expressions switched on.

    344
    MasterMaster
    344

      Dec 08, 2006#2

      UE 12, Perl/Unix style:

      replace
      (^\&sid).*$
      with
      $1

      Don't forget CRLF after last line.

      rds Bego
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      6,685587
      Grand MasterGrand Master
      6,685587

        Dec 08, 2006#3

        For completion, the UltraEdit style regular expression for this job is:

        Find What: %^(&sid^)*$
        Replace With: ^1

        Well, the ^( ^) in the search string could be also removed when the replace string contains &sid instead of ^1.

        Or if &sid is not at start of every line:

        Find What: &sid*$
        Replace With: &sid
        Best regards from an UC/UE/UES for Windows user from Austria