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

Can we write multiple lines at the same time

Expand Messages
  • wanna_be_guru
    Can we write multiple lines at the same time eg: I have following lines James Jack Kinny Desi and i want to edit above four lines to look as Hello world and
    Message 1 of 14 , Sep 14, 2004
      Can we write multiple lines at the same time

      eg:
      I have following lines
      James
      Jack
      Kinny
      Desi

      and i want to edit above four lines to look as
      Hello world and Hello EditPlus users James
      Hello world and Hello EditPlus users Jack
      Hello world and Hello EditPlus users Kinny
      Hello world and Hello EditPlus users Desi

      Without using regular expression, can i write same stuff on multiple
      lines at the same time. I know i can do this in Ultraedit, and this
      is the only reason i use ultraedit and would like to have this
      facility in Edit Plus.

      Thanks
      WBG
    • ben@dogscogs.com
      Hi, Yes you can... if you select the first character on all the lines with column select, and then right click, and choose format- fill column and then type
      Message 2 of 14 , Sep 14, 2004
        Hi,

        Yes you can... if you select the first character on all the lines with
        column select, and then right click, and choose format->fill column and then
        type what you want to appear in front there and click ok... that should do
        what you want it to do.

        Hope this helps

        Regards

        Ben


        -----Original Message-----
        From: wanna_be_guru [mailto:wanna_be_guru@...]
        Sent: 14 September 2004 22:34
        To: editplus@yahoogroups.com
        Subject: [edit+] Can we write multiple lines at the same time

        Can we write multiple lines at the same time

        eg:
        I have following lines
        James
        Jack
        Kinny
        Desi

        and i want to edit above four lines to look as
        Hello world and Hello EditPlus users James
        Hello world and Hello EditPlus users Jack
        Hello world and Hello EditPlus users Kinny
        Hello world and Hello EditPlus users Desi

        Without using regular expression, can i write same stuff on multiple
        lines at the same time. I know i can do this in Ultraedit, and this
        is the only reason i use ultraedit and would like to have this
        facility in Edit Plus.

        Thanks
        WBG





        http://www.editplus.com
        http://groups.yahoo.com/group/editplus
        Yahoo! Groups Links
      • dogscogs2001
        Hi, Yes you can... if you select the first character on all the lines with column select, and then right click, and choose format- fill column and then type
        Message 3 of 14 , Sep 14, 2004
          Hi,

          Yes you can... if you select the first character on all the lines
          with column select, and then right click, and choose format->fill
          column and then type what you want to appear in front there and click
          ok... that should do what you want it to do.

          Hope this helps

          Regards

          Ben

          P.S alternatively you could select all lines, right click and click
          comment lines, and then type the phrase you want to appear at the
          beginning of the lines.

          --- In editplus@yahoogroups.com, "wanna_be_guru" <wanna_be_guru@y...>
          wrote:
          > Can we write multiple lines at the same time
          >
          > eg:
          > I have following lines
          > James
          > Jack
          > Kinny
          > Desi
          >
          > and i want to edit above four lines to look as
          > Hello world and Hello EditPlus users James
          > Hello world and Hello EditPlus users Jack
          > Hello world and Hello EditPlus users Kinny
          > Hello world and Hello EditPlus users Desi
          >
          > Without using regular expression, can i write same stuff on
          multiple
          > lines at the same time. I know i can do this in Ultraedit, and this
          > is the only reason i use ultraedit and would like to have this
          > facility in Edit Plus.
          >
          > Thanks
          > WBG
        • DZ-Jay
          ... Pattern: ^ Replace With: Hello world and Hello EditPlus users ... Without a regular expression, there is no real way to tell EditPlus to add something to
          Message 4 of 14 , Sep 14, 2004
            Some time around 09/14/2004 17:33:42, I think I heard wanna_be_guru say:
            > Can we write multiple lines at the same time

            > eg:
            > I have following lines
            > James
            > Jack
            > Kinny
            > Desi

            > and i want to edit above four lines to look as
            > Hello world and Hello EditPlus users James
            > Hello world and Hello EditPlus users Jack
            > Hello world and Hello EditPlus users Kinny
            > Hello world and Hello EditPlus users Desi

            > Without using regular expression, can i write same stuff on multiple
            > lines at the same time. I know i can do this in Ultraedit, and this
            > is the only reason i use ultraedit and would like to have this
            > facility in Edit Plus.

            Why not use a regular expression? it would be very simple. If all you need to do is append to the beginning of the line, then you can do this:

            ------
            Pattern: ^
            Replace With: Hello world and Hello EditPlus users
            ------

            Without a regular expression, there is no real way to tell EditPlus to add something to the beginning of each line -- unless there is a specific pattern of characters that you want to replace.

            dZ.
          • Phil Henderson
            If you just want to prepend the lines (like in your example) then just highlight the lines, click Edit, Format, Line Comment, put in the text your want and
            Message 5 of 14 , Sep 14, 2004
              If you just want to prepend the lines (like in your example) then just
              highlight the lines, click Edit, Format, Line Comment, put in the text your
              want and click ok.

              Phil

              ----- Original Message -----
              From: "wanna_be_guru" <wanna_be_guru@...>
              To: <editplus@yahoogroups.com>
              Sent: Tuesday, September 14, 2004 5:33 PM
              Subject: [edit+] Can we write multiple lines at the same time


              > Can we write multiple lines at the same time
              >
              > eg:
              > I have following lines
              > James
              > Jack
              > Kinny
              > Desi
              >
              > and i want to edit above four lines to look as
              > Hello world and Hello EditPlus users James
              > Hello world and Hello EditPlus users Jack
              > Hello world and Hello EditPlus users Kinny
              > Hello world and Hello EditPlus users Desi
              >
              > Without using regular expression, can i write same stuff on multiple
              > lines at the same time. I know i can do this in Ultraedit, and this
              > is the only reason i use ultraedit and would like to have this
              > facility in Edit Plus.
              >
              > Thanks
              > WBG
              >
              >
              >
              >
              >
              > http://www.editplus.com
              > http://groups.yahoo.com/group/editplus
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >
            • hend7041
              If you just want to prepend the lines (like in your example) then highlight the lines, click Edit, Format, Line Comment, put in the text your want and click
              Message 6 of 14 , Sep 14, 2004
                If you just want to prepend the lines (like in your example) then
                highlight the lines, click Edit, Format, Line Comment, put in the
                text your want and click ok.

                Phil


                --- In editplus@yahoogroups.com, "wanna_be_guru"
                <wanna_be_guru@y...> wrote:
                > Can we write multiple lines at the same time
                >
                > eg:
                > I have following lines
                > James
                > Jack
                > Kinny
                > Desi
                >
                > and i want to edit above four lines to look as
                > Hello world and Hello EditPlus users James
                > Hello world and Hello EditPlus users Jack
                > Hello world and Hello EditPlus users Kinny
                > Hello world and Hello EditPlus users Desi
                >
                > Without using regular expression, can i write same stuff on
                multiple
                > lines at the same time. I know i can do this in Ultraedit, and
                this
                > is the only reason i use ultraedit and would like to have this
                > facility in Edit Plus.
                >
                > Thanks
                > WBG
              • Michael L. Jones
                Cool. I learned two things about EditPlus that I didn t know yesterday. My estimate of the percentage of the functionality that I know about keeps goes down
                Message 7 of 14 , Sep 15, 2004
                  Cool. I learned two things about EditPlus that I didn't know
                  yesterday. My estimate of the percentage of the functionality that I
                  know about keeps goes down <g>. Some of you guys must be really
                  heavy-duty users.

                  --- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
                  > Yes you can... if you select the first character on all the lines
                  > with column select, and then right click, and choose format->fill
                  > column and then type what you want to appear in front there and
                  click
                  > ok... that should do what you want it to do.
                  >
                  >
                  > P.S alternatively you could select all lines, right click and
                  click
                  > comment lines, and then type the phrase you want to appear at the
                  > beginning of the lines.
                • Dean Householder
                  I personally have two crucial macros that I use all the time. One is ALT+0 which will append whatever I have in my clipboard to the end of the current line
                  Message 8 of 14 , Sep 17, 2004
                    I personally have two crucial macros that I use all the time. One is
                    ALT+0 which will append whatever I have in my clipboard to the end of
                    the current line and then move the cursor to the beginning of the next
                    line. The other is ALT+9 which does the same for the beginning of a line.

                    So if I have 4 lines like:
                    James
                    Jack
                    Kinny
                    Desi

                    I copy to my clipboard the text (with a space at the end):
                    Hello world and Hello EditPlus users

                    And position my cursor in front of James and press ALT+9. The macro
                    (consisting of: CTRL+v, Home, Down) pastes the clipboard text in front
                    of my line and leaves my cursor at the beginning of the next line. I
                    just press ALT+9 4 times and I've got it. I never have to change this
                    macro. If I needed to do it 150 times in a row, I can just
                    Tools->Record->Playback Multiple and select Macro 9 and enter 150.

                    These combined with other permanent macros I have, have become by
                    lifeline. I have one which converts a line of HTML code to php printed
                    code escaping all double quotes. I also have a macro which converts
                    that back. I keep all my permanent macros above 5 and all the ones I
                    recreate for each project below. Beautiful system if you ask me. ;o)

                    P.S. My other useful tool would be the line comment which I set up a
                    keyboard shortcut as CTRL+ALT+C. Then you just highlight the lines,
                    press CTRL+ALT+C and enter the text you want to pre pend to each line.

                    Dean Householder



                    Michael L. Jones wrote:

                    >Cool. I learned two things about EditPlus that I didn't know
                    >yesterday. My estimate of the percentage of the functionality that I
                    >know about keeps goes down <g>. Some of you guys must be really
                    >heavy-duty users.
                    >
                    >--- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
                    >
                    >
                    >>Yes you can... if you select the first character on all the lines
                    >>with column select, and then right click, and choose format->fill
                    >>column and then type what you want to appear in front there and
                    >>
                    >>
                    >click
                    >
                    >
                    >>ok... that should do what you want it to do.
                    >>
                    >>
                    >>P.S alternatively you could select all lines, right click and
                    >>
                    >>
                    >click
                    >
                    >
                    >>comment lines, and then type the phrase you want to appear at the
                    >>beginning of the lines.
                    >>
                    >>
                    >
                    >
                    >
                    >
                    >
                    >http://www.editplus.com
                    >http://groups.yahoo.com/group/editplus
                    >Yahoo! Groups Links
                    >
                    >
                    >
                    >
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • WBG
                    Can I know how did you do your macros for the commenting, as I use a lot of commenting and uncommenting. Thanks WBG ... From: Dean Householder
                    Message 9 of 14 , Oct 1, 2004
                      Can I know how did you do your macros for the commenting, as I use a lot of
                      commenting and uncommenting.



                      Thanks

                      WBG



                      -----Original Message-----
                      From: Dean Householder [mailto:dh@...]
                      Sent: Friday, September 17, 2004 4:45 PM
                      To: editplus@yahoogroups.com
                      Subject: Re: [edit+] Re: Can we write multiple lines at the same time



                      I personally have two crucial macros that I use all the time. One is
                      ALT+0 which will append whatever I have in my clipboard to the end of
                      the current line and then move the cursor to the beginning of the next
                      line. The other is ALT+9 which does the same for the beginning of a line.

                      So if I have 4 lines like:
                      James
                      Jack
                      Kinny
                      Desi

                      I copy to my clipboard the text (with a space at the end):
                      Hello world and Hello EditPlus users

                      And position my cursor in front of James and press ALT+9. The macro
                      (consisting of: CTRL+v, Home, Down) pastes the clipboard text in front
                      of my line and leaves my cursor at the beginning of the next line. I
                      just press ALT+9 4 times and I've got it. I never have to change this
                      macro. If I needed to do it 150 times in a row, I can just
                      Tools->Record->Playback Multiple and select Macro 9 and enter 150.

                      These combined with other permanent macros I have, have become by
                      lifeline. I have one which converts a line of HTML code to php printed
                      code escaping all double quotes. I also have a macro which converts
                      that back. I keep all my permanent macros above 5 and all the ones I
                      recreate for each project below. Beautiful system if you ask me. ;o)

                      P.S. My other useful tool would be the line comment which I set up a
                      keyboard shortcut as CTRL+ALT+C. Then you just highlight the lines,
                      press CTRL+ALT+C and enter the text you want to pre pend to each line.

                      Dean Householder



                      Michael L. Jones wrote:

                      >Cool. I learned two things about EditPlus that I didn't know
                      >yesterday. My estimate of the percentage of the functionality that I
                      >know about keeps goes down <g>. Some of you guys must be really
                      >heavy-duty users.
                      >
                      >--- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
                      >
                      >
                      >>Yes you can... if you select the first character on all the lines
                      >>with column select, and then right click, and choose format->fill
                      >>column and then type what you want to appear in front there and
                      >>
                      >>
                      >click
                      >
                      >
                      >>ok... that should do what you want it to do.
                      >>
                      >>
                      >>P.S alternatively you could select all lines, right click and
                      >>
                      >>
                      >click
                      >
                      >
                      >>comment lines, and then type the phrase you want to appear at the
                      >>beginning of the lines.
                      >>
                      >>
                      >
                      >
                      >
                      >
                      >
                      >http://www.editplus.com
                      >http://groups.yahoo.com/group/editplus
                      >Yahoo! Groups Links
                      >
                      >
                      >
                      >
                      >
                      >
                      >


                      [Non-text portions of this message have been removed]



                      http://www.editplus.com
                      http://groups.yahoo.com/group/editplus






                      Yahoo! Groups Sponsor



                      ADVERTISEMENT

                      <http://us.ard.yahoo.com/SIG=129155jui/M=295196.4901138.6071305.3001176/D=gr
                      oups/S=1705351788:HM/EXP=1095543936/A=2128215/R=0/SIG=10se96mf6/*http:/compa
                      nion.yahoo.com> click here



                      <http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
                      :HM/A=2128215/rand=162377185>



                      _____

                      Yahoo! Groups Links

                      * To visit your group on the web, go to:
                      http://groups.yahoo.com/group/editplus/


                      * To unsubscribe from this group, send an email to:
                      editplus-unsubscribe@yahoogroups.com
                      <mailto:editplus-unsubscribe@yahoogroups.com?subject=Unsubscribe>


                      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                      <http://docs.yahoo.com/info/terms/> Service.



                      [Non-text portions of this message have been removed]
                    • Dean Householder
                      Yes, I d be glad to explain how I do it. My macro to take a line of HTML code and turn it into PHP code is: (assuming the cursor is at the beginning of the
                      Message 10 of 14 , Oct 1, 2004
                        Yes, I'd be glad to explain how I do it.

                        My macro to take a line of HTML code and turn it into PHP code is:
                        (assuming the cursor is at the beginning of the line)
                        print "
                        Shift+End
                        CTRL+h (Replace dialog)
                        "(in the Find What box)
                        \"(in the Replace With box)
                        (select the Selection radio button)
                        Replace All (and close the replace box)
                        End
                        ";

                        The reverse macro would delete print ", replace all \" with " and delete
                        the "; off of the end. I was very happy to discover that the replace
                        menu still works in a macro. This opens a million new possibilities!

                        Another of my favorite macros is one that adds quotes to all html tag
                        values that are not quoted. For example, if you had:
                        <table width=580 height=600>
                        It would change it to:
                        <table width="580" height="600">
                        which is XHTML compliant.

                        The Macro to do this is:
                        CTRL+h (Replace dialog)
                        Replace:
                        ( [a-z]+=)([a-z0-9#%]+)
                        With:
                        \1"\2"

                        It's a big time saver!

                        Good luck,
                        Dean Householder


                        WBG wrote:

                        >Can I know how did you do your macros for the commenting, as I use a lot of
                        >commenting and uncommenting.
                        >
                        >
                        >
                        >Thanks
                        >
                        >WBG
                        >
                        >
                        >
                        >-----Original Message-----
                        >From: Dean Householder [mailto:dh@...]
                        >Sent: Friday, September 17, 2004 4:45 PM
                        >To: editplus@yahoogroups.com
                        >Subject: Re: [edit+] Re: Can we write multiple lines at the same time
                        >
                        >
                        >
                        >I personally have two crucial macros that I use all the time. One is
                        >ALT+0 which will append whatever I have in my clipboard to the end of
                        >the current line and then move the cursor to the beginning of the next
                        >line. The other is ALT+9 which does the same for the beginning of a line.
                        >
                        >So if I have 4 lines like:
                        >James
                        >Jack
                        >Kinny
                        >Desi
                        >
                        >I copy to my clipboard the text (with a space at the end):
                        >Hello world and Hello EditPlus users
                        >
                        >And position my cursor in front of James and press ALT+9. The macro
                        >(consisting of: CTRL+v, Home, Down) pastes the clipboard text in front
                        >of my line and leaves my cursor at the beginning of the next line. I
                        >just press ALT+9 4 times and I've got it. I never have to change this
                        >macro. If I needed to do it 150 times in a row, I can just
                        >Tools->Record->Playback Multiple and select Macro 9 and enter 150.
                        >
                        >These combined with other permanent macros I have, have become by
                        >lifeline. I have one which converts a line of HTML code to php printed
                        >code escaping all double quotes. I also have a macro which converts
                        >that back. I keep all my permanent macros above 5 and all the ones I
                        >recreate for each project below. Beautiful system if you ask me. ;o)
                        >
                        >P.S. My other useful tool would be the line comment which I set up a
                        >keyboard shortcut as CTRL+ALT+C. Then you just highlight the lines,
                        >press CTRL+ALT+C and enter the text you want to pre pend to each line.
                        >
                        >Dean Householder
                        >
                        >
                        >
                        >Michael L. Jones wrote:
                        >
                        >
                        >
                        >>Cool. I learned two things about EditPlus that I didn't know
                        >>yesterday. My estimate of the percentage of the functionality that I
                        >>know about keeps goes down <g>. Some of you guys must be really
                        >>heavy-duty users.
                        >>
                        >>--- In editplus@yahoogroups.com, "dogscogs2001" <ben@d...> wrote:
                        >>
                        >>
                        >>
                        >>
                        >>>Yes you can... if you select the first character on all the lines
                        >>>with column select, and then right click, and choose format->fill
                        >>>column and then type what you want to appear in front there and
                        >>>
                        >>>
                        >>>
                        >>>
                        >>click
                        >>
                        >>
                        >>
                        >>
                        >>>ok... that should do what you want it to do.
                        >>>
                        >>>
                        >>>P.S alternatively you could select all lines, right click and
                        >>>
                        >>>
                        >>>
                        >>>
                        >>click
                        >>
                        >>
                        >>
                        >>
                        >>>comment lines, and then type the phrase you want to appear at the
                        >>>beginning of the lines.
                        >>>
                        >>>
                        >>>
                        >>>
                        >>
                        >>
                        >>
                        >>http://www.editplus.com
                        >>http://groups.yahoo.com/group/editplus
                        >>Yahoo! Groups Links
                        >>
                        >>
                        >>
                        >>
                        >>
                        >>
                        >>
                        >>
                        >>
                        >
                        >
                        >[Non-text portions of this message have been removed]
                        >
                        >
                        >
                        >http://www.editplus.com
                        >http://groups.yahoo.com/group/editplus
                        >
                        >
                        >
                        >
                        >
                        >
                        >Yahoo! Groups Sponsor
                        >
                        >
                        >
                        >ADVERTISEMENT
                        >
                        ><http://us.ard.yahoo.com/SIG=129155jui/M=295196.4901138.6071305.3001176/D=gr
                        >oups/S=1705351788:HM/EXP=1095543936/A=2128215/R=0/SIG=10se96mf6/*http:/compa
                        >nion.yahoo.com> click here
                        >
                        >
                        >
                        ><http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=
                        >:HM/A=2128215/rand=162377185>
                        >
                        >
                        >
                        > _____
                        >
                        >Yahoo! Groups Links
                        >
                        >* To visit your group on the web, go to:
                        >http://groups.yahoo.com/group/editplus/
                        >
                        >
                        >* To unsubscribe from this group, send an email to:
                        >editplus-unsubscribe@yahoogroups.com
                        ><mailto:editplus-unsubscribe@yahoogroups.com?subject=Unsubscribe>
                        >
                        >
                        >* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
                        ><http://docs.yahoo.com/info/terms/> Service.
                        >
                        >
                        >
                        >[Non-text portions of this message have been removed]
                        >
                        >
                        >
                        >
                        >http://www.editplus.com
                        >http://groups.yahoo.com/group/editplus
                        >Yahoo! Groups Links
                        >
                        >
                        >
                        >
                        >
                        >
                        >


                        [Non-text portions of this message have been removed]
                      • John Morse
                        Awesome! Thanks for sharing this with us. Works great for everything that doesn t have a space in-between, how can you change it so that if there is a space it
                        Message 11 of 14 , Oct 1, 2004
                          Awesome! Thanks for sharing this with us. Works great for everything
                          that doesn't have a space in-between, how can you change it so that if
                          there is a space it will account for it as well?
                          for example:
                          The macro changes this:
                          <META NAME=Author CONTENT=John Morse>
                          To this:
                          <META NAME="Author" CONTENT="John" Morse>
                          When it should be this:
                          <META NAME="Author" CONTENT="John Morse">
                          I'm sure its just needs a slight change to the regular expression
                          string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.

                          Thanks again!!!
                          ~John
                          "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"

                          Friday, October 1, 2004, 12:15:21 PM, you wrote:
                          DH> Another of my favorite macros is one that adds quotes to all html tag
                          DH> values that are not quoted. For example, if you had:
                          DH> <table width=580 height=600>
                          DH> It would change it to:
                          DH> <table width="580" height="600">
                          DH> which is XHTML compliant.

                          DH> The Macro to do this is:
                          DH> CTRL+h (Replace dialog)
                          DH> Replace:
                          DH> ( [a-z]+=)([a-z0-9#%]+)
                          DH> With:
                          DH> \1"\2"
                        • Dean Householder
                          There s not an easy way to capture these. The space is really the constant that I m depending on to delimit each attribute. I looked into modifying it to
                          Message 12 of 14 , Oct 4, 2004
                            There's not an easy way to capture these. The space is really the
                            constant that I'm depending on to delimit each attribute. I looked into
                            modifying it to look for either a > or another attribute with a value...
                            but then it actually captures the name of the tag itself, which in this
                            example is: "META".

                            So no this would not work with spaces. You can look at this to be a
                            great first stab at cleaning up your code but not an all-in-one
                            solution. If EditPlus supported Perl regular expressions instead of
                            just POSIX we would have a lot more power. There are some great options
                            like look-ahead parameters that could be considered, but this is not
                            currently allowed in EditPlus, unfortunately.

                            Good luck,
                            Dean Householder


                            John Morse wrote:

                            >Awesome! Thanks for sharing this with us. Works great for everything
                            >that doesn't have a space in-between, how can you change it so that if
                            >there is a space it will account for it as well?
                            >for example:
                            >The macro changes this:
                            ><META NAME=Author CONTENT=John Morse>
                            >To this:
                            ><META NAME="Author" CONTENT="John" Morse>
                            >When it should be this:
                            ><META NAME="Author" CONTENT="John Morse">
                            >I'm sure its just needs a slight change to the regular expression
                            >string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
                            >
                            >Thanks again!!!
                            >~John
                            >"Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
                            >
                            >Friday, October 1, 2004, 12:15:21 PM, you wrote:
                            >DH> Another of my favorite macros is one that adds quotes to all html tag
                            >DH> values that are not quoted. For example, if you had:
                            >DH> <table width=580 height=600>
                            >DH> It would change it to:
                            >DH> <table width="580" height="600">
                            >DH> which is XHTML compliant.
                            >
                            >DH> The Macro to do this is:
                            >DH> CTRL+h (Replace dialog)
                            >DH> Replace:
                            >DH> ( [a-z]+=)([a-z0-9#%]+)
                            >DH> With:
                            >DH> \1"\2"
                            >
                            >
                            >
                            >
                            >http://www.editplus.com
                            >http://groups.yahoo.com/group/editplus
                            >Yahoo! Groups Links
                            >
                            >
                            >
                            >
                            >
                            >
                            >


                            [Non-text portions of this message have been removed]
                          • tailing_loop2003
                            ... if ... It s been awhile since I ve done any regular expressions, but that looks like a pretty simple one. ( [a-z]+= ) [a-z] looks for any lower case
                            Message 13 of 14 , Oct 4, 2004
                              --- In editplus@yahoogroups.com, John Morse <john_morse@s...> wrote:
                              > Awesome! Thanks for sharing this with us. Works great for everything
                              > that doesn't have a space in-between, how can you change it so that
                              if
                              > there is a space it will account for it as well?
                              > for example:
                              > The macro changes this:
                              > <META NAME=Author CONTENT=John Morse>
                              > To this:
                              > <META NAME="Author" CONTENT="John" Morse>
                              > When it should be this:
                              > <META NAME="Author" CONTENT="John Morse">
                              > I'm sure its just needs a slight change to the regular expression
                              > string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
                              >

                              It's been awhile since I've done any regular expressions, but that
                              looks like a pretty simple one.

                              ( [a-z]+= )

                              [a-z] looks for any lower case character
                              [a-z]+ looks for a lower case character 1 or more times
                              [a-z]+= looks for a lower case character 1 or more times followed by
                              an equals sign.

                              The parentheses just delimit that group(which comes into play later
                              with the replacement expression).

                              For the next part of the regular expression:

                              ( [a-z0-9#%]+ )

                              [a-z0-9#%] looks for the characters a-z, or 0-9, or #, or %, with the
                              plus sign once again meaning one or more times.

                              So, putting it all together, the expression looks for:

                              the characters a-z one or more times, followed by an equals sign,
                              followed by the characters a-z, 0-9, #, or % one or more times.

                              Hopefully, that wasn't too confusing. Now it's time to look
                              at what
                              matches to the regular expression will be replaced by:

                              \1"\2"

                              If I remember correctly, \1 stands for whatever matches what's in
                              the
                              first set of parentheses in the regular expression, and \2 stands for
                              whatever matches what's in the second set of parentheses in the
                              regular expression. Therefore, you can add parentheses to a regular
                              expression in order to refer to them later in the replacement
                              expression, and the first set of parenthesis will always be \1 and the
                              second set will always be \2, and so on. Since the quotes are added
                              around \2, whatever matches the second set of parenthesis in the
                              regular expression will be enclosed in quotes.

                              Now, to answer your question (finally!). All you have to do is add a
                              space to the expression in the second set of parenthesis, like this:

                              ([a-z0-9#% ]+)

                              For image names, like myimage.jpg, in order to put quotes around the
                              whole name, for example:

                              href="myimage.jpg"

                              instead of this(which happens with the current regular expression):

                              href="myimage".jpg

                              you also need to add a period to the second set of parentheses in the
                              regular expression. However, a period has a special meaning in
                              regular expressions, so if you literally want to signify a period, you
                              have to precede it with a '\':

                              ( [a-z0-9#% \.]+ )

                              Since, I also use names for my images like:

                              my_image.jpg

                              I would also add the underscore to the second set of parentheses in
                              the regular expression:

                              ( [a-z0-9#% \._]+ )




                              > Thanks again!!!
                              > ~John
                              > "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
                              >
                              > Friday, October 1, 2004, 12:15:21 PM, you wrote:
                              > DH> Another of my favorite macros is one that adds quotes to all
                              html tag
                              > DH> values that are not quoted. For example, if you had:
                              > DH> <table width=580 height=600>
                              > DH> It would change it to:
                              > DH> <table width="580" height="600">
                              > DH> which is XHTML compliant.
                              >
                              > DH> The Macro to do this is:
                              > DH> CTRL+h (Replace dialog)
                              > DH> Replace:
                              > DH> ( [a-z]+=)([a-z0-9#%]+)
                              > DH> With:
                              > DH> \1"\2"
                            • tailing_loop2003
                              Well, after I posted, I noticed that I failed to realize that there was a leading space in the regex: ( [a-z]+=)([a-z0-9#%]+) Also, in the interest of making
                              Message 14 of 14 , Oct 4, 2004
                                Well, after I posted, I noticed that I failed to realize that there
                                was a leading space in the regex:

                                ( [a-z]+=)([a-z0-9#%]+)

                                Also, in the interest of making the regex more readable, I moved the
                                enclosing parenthesis wider in my post, which I now realize adds space
                                characters to the regex which affects the search:

                                ( [a-z]+= )

                                That's wrong!

                                Finally, as Dean Householder pointed out, a space is the key to
                                discern when an html attribute ends. However, I set up a macro with
                                the regex Dean posted modified for spaces, so that it applies only to
                                the selection I highlight. So, I can handle something like this:

                                <META NAME=Author CONTENT=John Morse>

                                by highlighting only:

                                CONTENT=John Morse>

                                and then the quotes are added like so:

                                <META NAME=Author CONTENT="John Morse">

                                It's an extra macro you have to run, but it's something to consider.
                                I believe if you run that macro first on any parts of your html where
                                the attribute has two words, then you can run the original macro
                                posted by Dean to handle the rest of your code—it won't
                                affect the
                                quotes on the two word attributes. Of course, that means you have to
                                know ahead of time that there are some two word attributes and where
                                they are located.




                                --- In editplus@yahoogroups.com, "tailing_loop2003"
                                <tailing_loop2003@y...> wrote:
                                >
                                >
                                > --- In editplus@yahoogroups.com, John Morse <john_morse@s...> wrote:
                                > > Awesome! Thanks for sharing this with us. Works great for
                                everything
                                > > that doesn't have a space in-between, how can you change it so
                                that
                                > if
                                > > there is a space it will account for it as well?
                                > > for example:
                                > > The macro changes this:
                                > > <META NAME=Author CONTENT=John Morse>
                                > > To this:
                                > > <META NAME="Author" CONTENT="John" Morse>
                                > > When it should be this:
                                > > <META NAME="Author" CONTENT="John Morse">
                                > > I'm sure its just needs a slight change to the regular expression
                                > > string ( [a-z]+=)([a-z0-9#%]+) but i'm not sure what to add to it.
                                > >
                                >
                                > It's been awhile since I've done any regular expressions, but that
                                > looks like a pretty simple one.
                                >
                                > ( [a-z]+= )
                                >
                                > [a-z] looks for any lower case character
                                > [a-z]+ looks for a lower case character 1 or more times
                                > [a-z]+= looks for a lower case character 1 or more times followed
                                by
                                > an equals sign.
                                >
                                > The parentheses just delimit that group(which comes into play later
                                > with the replacement expression).
                                >
                                > For the next part of the regular expression:
                                >
                                > ( [a-z0-9#%]+ )
                                >
                                > [a-z0-9#%] looks for the characters a-z, or 0-9, or #, or %, with
                                the
                                > plus sign once again meaning one or more times.
                                >
                                > So, putting it all together, the expression looks for:
                                >
                                > the characters a-z one or more times, followed by an equals sign,
                                > followed by the characters a-z, 0-9, #, or % one or more times.
                                >
                                > Hopefully, that wasn't too confusing. Now it's time to look
                                > at what
                                > matches to the regular expression will be replaced by:
                                >
                                > \1"\2"
                                >
                                > If I remember correctly, \1 stands for whatever matches what's in
                                > the
                                > first set of parentheses in the regular expression, and \2 stands
                                for
                                > whatever matches what's in the second set of parentheses in the
                                > regular expression. Therefore, you can add parentheses to a regular
                                > expression in order to refer to them later in the replacement
                                > expression, and the first set of parenthesis will always be \1 and
                                the
                                > second set will always be \2, and so on. Since the quotes are added
                                > around \2, whatever matches the second set of parenthesis in the
                                > regular expression will be enclosed in quotes.
                                >
                                > Now, to answer your question (finally!). All you have to do is add
                                a
                                > space to the expression in the second set of parenthesis, like this:
                                >
                                > ([a-z0-9#% ]+)
                                >
                                > For image names, like myimage.jpg, in order to put quotes around the
                                > whole name, for example:
                                >
                                > href="myimage.jpg"
                                >
                                > instead of this(which happens with the current regular expression):
                                >
                                > href="myimage".jpg
                                >
                                > you also need to add a period to the second set of parentheses in
                                the
                                > regular expression. However, a period has a special meaning in
                                > regular expressions, so if you literally want to signify a period,
                                you
                                > have to precede it with a '\':
                                >
                                > ( [a-z0-9#% \.]+ )
                                >
                                > Since, I also use names for my images like:
                                >
                                > my_image.jpg
                                >
                                > I would also add the underscore to the second set of parentheses in
                                > the regular expression:
                                >
                                > ( [a-z0-9#% \._]+ )
                                >
                                >
                                >
                                >
                                > > Thanks again!!!
                                > > ~John
                                > > "Oh Lord, give me patience. But give it to me RIGHT BLOODY NOW!"
                                > >
                                > > Friday, October 1, 2004, 12:15:21 PM, you wrote:
                                > > DH> Another of my favorite macros is one that adds quotes to all
                                > html tag
                                > > DH> values that are not quoted. For example, if you had:
                                > > DH> <table width=580 height=600>
                                > > DH> It would change it to:
                                > > DH> <table width="580" height="600">
                                > > DH> which is XHTML compliant.
                                > >
                                > > DH> The Macro to do this is:
                                > > DH> CTRL+h (Replace dialog)
                                > > DH> Replace:
                                > > DH> ( [a-z]+=)([a-z0-9#%]+)
                                > > DH> With:
                                > > DH> \1"\2"
                              Your message has been successfully submitted and would be delivered to recipients shortly.