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

Help with Regular expression search

Expand Messages
  • job.noam
    Hello All, I try to use the Regular expression search option in the editor but I don t understand how to do that. I have all over my website lines like that:
    Message 1 of 5 , Oct 16, 2007
      Hello All,

      I try to use the Regular expression search option in the editor but I
      don't understand how to do that.
      I have all over my website lines like that:
      <span slang="Man"><%=tranInter.Item("Man")%></span>
      OR
      <span slang="Women"
      style="font-size:4px;"><%=tranInter.Item("Women")%></span>
      OR
      <span style="font-size:4px;"
      slang="Boy"><%=tranInter.Item("Boy")%></span>

      And more lines that look like that.
      I like to find all the lines that look like this:
      <span slang="Man">Man</span>
      OR
      <span slang="Women" style="font-size:4px;">Women</span>
      OR
      <span style="font-size:4px;" slang="Boy">Boy</span>


      I believe that if I negative my search to something like that:
      (<span slang=".+">[^<]).+([^>]</span>)
      (I know it's worng)

      It's will be the best.

      Thanks for any help you can give me.
    • DZ-Jay
      It depends on the information that you want to capture from the regular expression. Here s an example that will capture most of what (to me) seems important:
      Message 2 of 5 , Oct 17, 2007
        It depends on the information that you want to capture from the regular
        expression.

        Here's an example that will capture most of what (to me) seems
        important:

        <span .+(slang="([^"])")[^>]*> *(<%= *tranInter.Item\("([^]+)"\)
        *%>|([^<]+)) *</span>

        \2 : the value of the "slang" attribute
        \4 : the key of tranInter.Item() collection
        \5 : the text within the <span> tag.

        \4 or \5 will be mutually exclusive, that is, either
        tranInter.Item("X") or a string "X" appears in there, but not both.
        This conforms with your examples.

        dZ.

        On Oct 16, 2007, at 10:21, job.noam wrote:

        > Hello All,
        >
        > I try to use the Regular expression search option in the editor but I
        > don't understand how to do that.
        > I have all over my website lines like that:
        > <span slang="Man"><%=tranInter.Item("Man")%></span>
        > OR
        > <span slang="Women"
        > style="font-size:4px;"><%=tranInter.Item("Women")%></span>
        > OR
        > <span style="font-size:4px;"
        > slang="Boy"><%=tranInter.Item("Boy")%></span>
        >
        > And more lines that look like that.
        > I like to find all the lines that look like this:
        > <span slang="Man">Man</span>
        > OR
        > <span slang="Women" style="font-size:4px;">Women</span>
        > OR
        > <span style="font-size:4px;" slang="Boy">Boy</span>
        >
        >
        > I believe that if I negative my search to something like that:
        > (<span slang=".+">[^<]).+([^>]</span>)
        > (I know it's worng)
        >
        > It's will be the best.
        >
        > Thanks for any help you can give me.

        --
        DZ vs. The World:
        Hating anything, everything and everyone since 1996.
      • Mark Kahn
        If the spans are ALWAYS one one line: ( )([^ n]+)( ) ideally you want to do something that Edit+ doesn t support, which is non-greedy
        Message 3 of 5 , Oct 17, 2007
          If the spans are ALWAYS one one line:

          (<span [^\n]+>)([^\n]+)(</span [^\n]+>)

          ideally you want to do something that Edit+ doesn't support, which is
          non-greedy regex's. I have a tool on editplus.info that does this if you
          really want to: (<span.*?>)(.*?)(</span.*?>)

          or use DZ's solution if it's always the same format.

          -Mark

          On 10/16/07, job.noam <job.noam@...> wrote:
          >
          > Hello All,
          >
          > I try to use the Regular expression search option in the editor but I
          > don't understand how to do that.
          > I have all over my website lines like that:
          > <span slang="Man"><%=tranInter.Item("Man")%></span>
          > OR
          > <span slang="Women"
          > style="font-size:4px;"><%=tranInter.Item("Women")%></span>
          > OR
          > <span style="font-size:4px;"
          > slang="Boy"><%=tranInter.Item("Boy")%></span>
          >
          > And more lines that look like that.
          > I like to find all the lines that look like this:
          > <span slang="Man">Man</span>
          > OR
          > <span slang="Women" style="font-size:4px;">Women</span>
          > OR
          > <span style="font-size:4px;" slang="Boy">Boy</span>
          >
          > I believe that if I negative my search to something like that:
          > (<span slang=".+">[^<]).+([^>]</span>)
          > (I know it's worng)
          >
          > It's will be the best.
          >
          > Thanks for any help you can give me.
          >
          >
          >


          [Non-text portions of this message have been removed]
        • toe_bot_c
          Hey Mr. Kahn, where is the tool? I checked the Wiki (at your site) and saw no mention of it. Thanks. ... if you
          Message 4 of 5 , Oct 18, 2007
            Hey Mr. Kahn, where is the tool? I checked the Wiki (at your site)
            and saw no mention of it.

            Thanks.

            --- In editplus@yahoogroups.com, "Mark Kahn" <cwolves@...> wrote:
            >
            > If the spans are ALWAYS one one line:
            >
            > (<span [^\n]+>)([^\n]+)(</span [^\n]+>)
            >
            > ideally you want to do something that Edit+ doesn't support, which is
            > non-greedy regex's. I have a tool on editplus.info that does this
            if you
            > really want to: (<span.*?>)(.*?)(</span.*?>)
            >
            > or use DZ's solution if it's always the same format.
            >
            > -Mark
            >
            > On 10/16/07, job.noam <job.noam@...> wrote:
            > >
            > > Hello All,
            > >
            > > I try to use the Regular expression search option in the editor but I
            > > don't understand how to do that.
            > > I have all over my website lines like that:
            > > <span slang="Man"><%=tranInter.Item("Man")%></span>
            > > OR
            > > <span slang="Women"
            > > style="font-size:4px;"><%=tranInter.Item("Women")%></span>
            > > OR
            > > <span style="font-size:4px;"
            > > slang="Boy"><%=tranInter.Item("Boy")%></span>
            > >
            > > And more lines that look like that.
            > > I like to find all the lines that look like this:
            > > <span slang="Man">Man</span>
            > > OR
            > > <span slang="Women" style="font-size:4px;">Women</span>
            > > OR
            > > <span style="font-size:4px;" slang="Boy">Boy</span>
            > >
            > > I believe that if I negative my search to something like that:
            > > (<span slang=".+">[^<]).+([^>]</span>)
            > > (I know it's worng)
            > >
            > > It's will be the best.
            > >
            > > Thanks for any help you can give me.
            > >
            > >
            > >
            >
            >
            > [Non-text portions of this message have been removed]
            >
          • Mark Kahn
            http://editplus.info/wiki/User_Tools#Full_RegEx_Supported_Replace_and_More.21 ... [Non-text portions of this message have been removed]
            Message 5 of 5 , Oct 18, 2007
              http://editplus.info/wiki/User_Tools#Full_RegEx_Supported_Replace_and_More.21

              On 10/18/07, toe_bot_c <toe_bot_c@...> wrote:
              >
              > Hey Mr. Kahn, where is the tool? I checked the Wiki (at your site)
              > and saw no mention of it.
              >
              > Thanks.
              >
              > --- In editplus@yahoogroups.com <editplus%40yahoogroups.com>, "Mark Kahn"
              > <cwolves@...> wrote:
              > >
              > > If the spans are ALWAYS one one line:
              > >
              > > (<span [^\n]+>)([^\n]+)(</span [^\n]+>)
              > >
              > > ideally you want to do something that Edit+ doesn't support, which is
              > > non-greedy regex's. I have a tool on editplus.info that does this
              > if you
              > > really want to: (<span.*?>)(.*?)(</span.*?>)
              > >
              > > or use DZ's solution if it's always the same format.
              > >
              > > -Mark
              > >
              > > On 10/16/07, job.noam <job.noam@...> wrote:
              > > >
              > > > Hello All,
              > > >
              > > > I try to use the Regular expression search option in the editor but I
              > > > don't understand how to do that.
              > > > I have all over my website lines like that:
              > > > <span slang="Man"><%=tranInter.Item("Man")%></span>
              > > > OR
              > > > <span slang="Women"
              > > > style="font-size:4px;"><%=tranInter.Item("Women")%></span>
              > > > OR
              > > > <span style="font-size:4px;"
              > > > slang="Boy"><%=tranInter.Item("Boy")%></span>
              > > >
              > > > And more lines that look like that.
              > > > I like to find all the lines that look like this:
              > > > <span slang="Man">Man</span>
              > > > OR
              > > > <span slang="Women" style="font-size:4px;">Women</span>
              > > > OR
              > > > <span style="font-size:4px;" slang="Boy">Boy</span>
              > > >
              > > > I believe that if I negative my search to something like that:
              > > > (<span slang=".+">[^<]).+([^>]</span>)
              > > > (I know it's worng)
              > > >
              > > > It's will be the best.
              > > >
              > > > Thanks for any help you can give me.
              > > >
              > > >
              > > >
              > >
              > >
              > > [Non-text portions of this message have been removed]
              > >
              >
              >
              >


              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.