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

Re: [edit+] Search and replace with match

Expand Messages
  • dz@caribe.net
    ... From: ssalter2006 Sent: 6/13/2006 10:43:46 AM To: editplus@yahoogroups.com Subject: [edit+] Search and replace with match ... Use parentheses to group the
    Message 1 of 4 , Jun 13, 2006
    • 0 Attachment
      ----- Original Message -----
      From: ssalter2006
      Sent: 6/13/2006 10:43:46 AM
      To: editplus@yahoogroups.com
      Subject: [edit+] Search and replace with match

      > I've got groups of radio buttons named like this:
      >
      > <td><input type=radio name=rad1 value=4></td>
      > <td><input type=radio name=rad1 value=3></td>
      > <td><input type=radio name=rad1 value=2></td>
      > <td><input type=radio name=rad1 value=1></td>
      >
      > Goes from rad1 to rad45 groups.
      >
      > and I'd like to change the "rad" to "Question" but keep the number, ie:
      > rad1 group turns into Question1 group.
      >
      > I can match the "rad" with this: name=rad*[0-9] but how do I do a
      > replace that keeps the radio button group number?

      Use parentheses to group the matches:

      Find: (name=)rad([0-9]+)
      Replace: \1Question\2

      That will hold the first grouped match in \1 and the second one in \2, and replaces it with the first match, followed by the string "Question, followed by the second match; so that "name=rad1", say, turns into "name=Question1".

      P.S. The '*' symbol goes on the right of the digit range to signify 0 or more digits. As you put it, it means "0 or more 'd's", so it will match "rad1", "ra3", and "raddddddd3".

      -dZ.
    • dz@caribe.net
      [0-9][0-9]* is the same as [0-9]+ -dZ. ... From: Getafixx Sent: 6/13/2006 12:20:02 PM To: editplus@yahoogroups.com Subject: Re: [edit+] Search and replace with
      Message 2 of 4 , Jun 13, 2006
      • 0 Attachment
        [0-9][0-9]* is the same as [0-9]+

        -dZ.

        ----- Original Message -----
        From: Getafixx
        Sent: 6/13/2006 12:20:02 PM
        To: editplus@yahoogroups.com
        Subject: Re: [edit+] Search and replace with match

        > Search for rad([0-9][0-9]*)
        > replace with question\1
        >
        > Justin
        > --
        > Justin / Getafixx
        > Download Getafixx's latest ambient electronic mix - Ideomotor Action
        >
        > http://getafixx.com/music/mixes/ideomotor_action/
        >
        > http://getafixx.com - aural bliss
        > http://getafixxhosting.com for really cheap web hosting
        >
        > ssalter2006 wrote:
        > > I've got groups of radio buttons named like this:
        > >
        > > <td><input type=radio name=rad1 value=4></td>
        > > <td><input type=radio name=rad1 value=3></td>
        > > <td><input type=radio name=rad1 value=2></td>
        > > <td><input type=radio name=rad1 value=1></td>
        > >
        > > Goes from rad1 to rad45 groups.
        > >
        > > and I'd like to change the "rad" to "Question" but keep the number, ie:
        > > rad1 group turns into Question1 group.
        > >
        > > I can match the "rad" with this: name=rad*[0-9] but how do I do a
        > > replace that keeps the radio button group number?
        > >
        > > Thanks.
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > > http://www.editplus.com
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > > .
        > >
        >
        >
        >
        >
        >
        > http://www.editplus.com
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
      • Getafixx
        indeed. Sorry about that.. I wasn t thinking straight... J. ... -- Justin / Getafixx Download Getafixx s latest ambient electronic mix - Ideomotor Action
        Message 3 of 4 , Jun 13, 2006
        • 0 Attachment
          indeed. Sorry about that.. I wasn't thinking straight...

          J.

          dz@... wrote:
          > [0-9][0-9]* is the same as [0-9]+
          >
          > -dZ.
          >
          > ----- Original Message -----
          > From: Getafixx
          > Sent: 6/13/2006 12:20:02 PM
          > To: editplus@yahoogroups.com
          > Subject: Re: [edit+] Search and replace with match
          >
          >> Search for rad([0-9][0-9]*)
          >> replace with question\1
          >>
          >> Justin
          >> --
          >> Justin / Getafixx
          >> Download Getafixx's latest ambient electronic mix - Ideomotor Action
          >>
          >> http://getafixx.com/music/mixes/ideomotor_action/
          >>
          >> http://getafixx.com - aural bliss
          >> http://getafixxhosting.com for really cheap web hosting
          >>
          >> ssalter2006 wrote:
          >>> I've got groups of radio buttons named like this:
          >>>
          >>> <td><input type=radio name=rad1 value=4></td>
          >>> <td><input type=radio name=rad1 value=3></td>
          >>> <td><input type=radio name=rad1 value=2></td>
          >>> <td><input type=radio name=rad1 value=1></td>
          >>>
          >>> Goes from rad1 to rad45 groups.
          >>>
          >>> and I'd like to change the "rad" to "Question" but keep the number, ie:
          >>> rad1 group turns into Question1 group.
          >>>
          >>> I can match the "rad" with this: name=rad*[0-9] but how do I do a
          >>> replace that keeps the radio button group number?
          >>>
          >>> Thanks.
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>> http://www.editplus.com
          >>> Yahoo! Groups Links
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>>
          >>> .
          >>>
          >>
          >>
          >>
          >>
          >> http://www.editplus.com
          >> Yahoo! Groups Links
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >>
          >
          >
          >
          >
          > http://www.editplus.com
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >

          --
          Justin / Getafixx
          Download Getafixx's latest ambient electronic mix - Ideomotor Action

          http://getafixx.com/music/mixes/ideomotor_action/

          http://getafixx.com - aural bliss
          http://getafixxhosting.com for really cheap web hosting
        • ssalter2006
          Thank you all very much!! ... do a ... 2, and replaces it with the first match, followed by the string Question, followed by the second match; so that
          Message 4 of 4 , Jun 14, 2006
          • 0 Attachment
            Thank you all very much!!


            --- In editplus@yahoogroups.com, "" <dz@...> wrote:
            >
            >
            >
            > ----- Original Message -----
            > From: ssalter2006
            > Sent: 6/13/2006 10:43:46 AM
            > To: editplus@yahoogroups.com
            > Subject: [edit+] Search and replace with match
            >
            > > I've got groups of radio buttons named like this:
            > >
            > > <td><input type=radio name=rad1 value=4></td>
            > > <td><input type=radio name=rad1 value=3></td>
            > > <td><input type=radio name=rad1 value=2></td>
            > > <td><input type=radio name=rad1 value=1></td>
            > >
            > > Goes from rad1 to rad45 groups.
            > >
            > > and I'd like to change the "rad" to "Question" but keep the
            number, ie:
            > > rad1 group turns into Question1 group.
            > >
            > > I can match the "rad" with this: name=rad*[0-9] but how do I
            do a
            > > replace that keeps the radio button group number?
            >
            > Use parentheses to group the matches:
            >
            > Find: (name=)rad([0-9]+)
            > Replace: \1Question\2
            >
            > That will hold the first grouped match in \1 and the second one in
            \2, and replaces it with the first match, followed by the
            string "Question, followed by the second match; so that "name=rad1",
            say, turns into "name=Question1".
            >
            > P.S. The '*' symbol goes on the right of the digit range to signify
            0 or more digits. As you put it, it means "0 or more 'd's", so it
            will match "rad1", "ra3", and "raddddddd3".
            >
            > -dZ.
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.