Loading ...
Sorry, an error occurred while loading the content.
 

Re: Regular expression?

Expand Messages
  • Hugo Paulissen
    ... I doubt if you need a regular expression for this... You can search for 1. = and replace it with = and 2. ^P and replace it with ^P This
    Message 1 of 4 , Sep 13, 2004
      >
      > MIT => Massachusetts Institute of Technology
      >
      > And I need to add two " characters to each line, like this:
      >
      > "MIT" => Massachusetts Institute of Technology
      >

      I doubt if you need a regular expression for this... You can search
      for
      1. " => " and replace it with "" => "
      and
      2. "^P" and replace it with "^P""

      This approach probably leaves you with some lines starting with ",
      but these can be fixed manually (I hope). If you *do* need a regular
      expression, come over to/sign up for the clipslist: we will serve you
      there.

      Regards,

      Hugo
    • hsavage
      ... rogi, I m a novice at regexp also but, I worked out this formula; To use in clip command form use, ^!Replace ^{ W+} s = 1 s = WRSA To use in the
      Message 2 of 4 , Sep 13, 2004
        rogi_x wrote:
        > Here's a question that I can't seem to figure out an answer
        > to. I have
        > a plain text document that contains a list of hundreds and hundreds of
        > items like this one:
        >
        >> Massachusetts Institute of Technology
        >
        > And I need to add two " characters to each line, like this:
        >
        >> Massachusetts Institute of Technology
        >
        > That's all I need to do.
        >
        > I assume that a regular expression in Notetab Pro will do the trick,
        > but my knowledge of how to use tose is minimal, to put it mildly.
        >
        > Any pointers or advice gratefully accepted!

        rogi,

        I'm a novice at regexp also but, I worked out this formula;

        To use in clip command form use,

        ^!Replace ^{\W+}\s\= >> \"\1\"\s\= WRSA

        To use in the 'find and replace' dialog first,

        open find/replace,

        type in 'find side' ^{\W+}\s\=

        type in 'replace side' \"\1\"\s\=

        under 'Search' select 'All'

        tick the 'Regular Exp.' box

        be sure nothing else is checked and click 'Replace All'.

        This is a sampling of the one line you furnished, altered slightly with
        digits in some and quotes already around another acronym.

        7IT => Massachusetts Institute of Technology
        M7T => Massachusetts Institute of Technology
        "M2T" => Massachusetts Institute of Technology
        MI2 => Massachusetts Institute of Technology
        3IT => Massachusetts Institute of Technology
        M3T => Massachusetts Institute of Technology
        MI4 => Massachusetts Institute of Technology
        MI4 => Massachusetts Institute of Technology

        This formula worked in all these cases without leaving any double,
        double quotes.

        You should try it on your own sample file first before committing to use
        on your permanent file.

        hrs
      • rogi_x
        ... This worked perfectly. Thanks v.much for your help, (and for figuring it out). :) -- Rogi.
        Message 3 of 4 , Sep 13, 2004
          --- In notetab@yahoogroups.com, hsavage <hsavage@p...> wrote:
          > rogi_x wrote:
          > >
          > > Any pointers or advice gratefully accepted!
          >
          > rogi,
          >
          > I'm a novice at regexp also but, I worked out this formula;
          >
          > To use in clip command form use,
          >
          > ^!Replace ^{\W+}\s\= >> \"\1\"\s\= WRSA
          >
          > To use in the 'find and replace' dialog first,
          >
          > open find/replace,
          >
          > type in 'find side' ^{\W+}\s\=
          >
          > type in 'replace side' \"\1\"\s\=
          >
          > under 'Search' select 'All'
          >
          > tick the 'Regular Exp.' box
          >
          > be sure nothing else is checked and click 'Replace All'.

          This worked perfectly. Thanks v.much for your help,
          (and for figuring it out). :)

          -- Rogi.
        Your message has been successfully submitted and would be delivered to recipients shortly.