<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Roman,<br>
    <br>
    1) Yes, the rule seems useful, thanks! You can create a PR, or shall
    I?<br>
    <br>
    2) How about leaving out the &lt;where&gt;:<br>
    <br>
          &lt;filecontent filename="{*}.jsp"
    pattern="import=&amp;quot;&amp;quot;" /&gt;<br>
    <br>
    &lt;where&gt; is generally useful if you need to match a regex, or
    refer to the value somewhere else in the rule.<br>
    <br>
    Ondra<br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 21.4.2016 09:40, Roman Martin Gil
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHFLequvgS2bOkkfUS_k56fkzHKV7KBs5ghLMzG++VZ4YV=JRQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks Ondrej, my latest rule version is working as
        I want.
        <div><br>
        </div>
        <div>Now I create a new rule to identify page import definitions
          empty (&lt;%@ page import="" %&gt;, .... this line in WAS is
          working successfully 🤔 but in EAP not (compile error).</div>
        <div><br>
        </div>
        <div>
          <div><span class="" style="white-space:pre">                </span>&lt;rule
            id="jsp-empty-imports"&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;when&gt;</div>
          <div><span class="" style="white-space:pre">                                </span>&lt;filecontent
            filename="{*}.jsp" pattern="import={emptyString}" /&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;/when&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;perform&gt;</div>
          <div><span class="" style="white-space:pre">                                </span>&lt;hint
            message="Empty imports definition in a jsp" effort="1"
            severity="mandatory"&gt;</div>
          <div><span class="" style="white-space:pre">                                        </span>&lt;message&gt;</div>
          <div>                        Empty import definitions in .jsp
            or .jspf files will fail in compilation time. It is needed
            to</div>
          <div>                        remove them.</div>
          <div>                    &lt;/message&gt;</div>
          <div><span class="" style="white-space:pre">                                </span>&lt;/hint&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;/perform&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;where
            param="emptyString"&gt;</div>
          <div><span class="" style="white-space:pre">                                </span>&lt;matches
            pattern="(&amp;quot;&amp;quot;)" /&gt;</div>
          <div><span class="" style="white-space:pre">                        </span>&lt;/where&gt;</div>
          <div><span class="" style="white-space:pre">                </span>&lt;/rule&gt;</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I think that rule is also important in other migrations so
          WindUp could introduce in its global rules. What do you think?</div>
        <div><br>
        </div>
        <div>Regards</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Thu, Apr 21, 2016 at 4:58 AM, Ondrej
          Zizka <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">For the
            cases like "Message: ", i'd suggest to use negative
            lookbehind:<br>
            <br>
            (?&lt;!\w)[a-z]:[\\\\|/]<br>
            <br>
            Which basically says, make sure there's no word character
            prior to the potential drive letter.<br>
            <br>
            Ondra
            <div class="HOEnZb">
              <div class="h5"><br>
                <br>
                <br>
                On 20.4.2016 16:02, Marek Novotny wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  forgot to include Romain in CC<br>
                  <br>
                  On 20.4.2016 16:01, Brad Davis wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0
                    .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    +1 -- it is not only important for Windows to Linux,
                    but also for identifying file read / writes that
                    need to be mounted for cloud deployments to things
                    like OpenShift.<br>
                    <br>
                    Brad Davis<br>
                    Director of FSI Solutions, Red Hat Consulting<br>
                    Email: <a moz-do-not-send="true"
                      href="mailto:bdavis@redhat.com" target="_blank">bdavis@redhat.com</a>
                    | c: <a moz-do-not-send="true"
                      href="tel:980.226.7865" value="+19802267865"
                      target="_blank">980.226.7865</a> | <a
                      moz-do-not-send="true"
                      href="http://www.redhat.com" rel="noreferrer"
                      target="_blank"><a class="moz-txt-link-freetext" href="http://www.redhat.com">http://www.redhat.com</a></a><br>
                    <br>
                    ----- Original Message -----<br>
                    From: "Marek Novotny" &lt;<a moz-do-not-send="true"
                      href="mailto:mnovotny@redhat.com" target="_blank">mnovotny@redhat.com</a>&gt;<br>
                    To: "Windup-dev List" &lt;<a moz-do-not-send="true"
                      href="mailto:windup-dev@lists.jboss.org"
                      target="_blank">windup-dev@lists.jboss.org</a>&gt;<br>
                    Sent: Wednesday, April 20, 2016 9:49:31 AM<br>
                    Subject: [windup-dev] Fwd: [WindUp] Regular
                    expression to detect filesystem     paths<br>
                    <br>
                    adding windup-dev ml as this could be interested to
                    Windup community.<br>
                    <br>
                    <br>
                    Romain,<br>
                    <br>
                      I would go with simplified pattern for every
                    unique occurrence to more<br>
                    more general one.<br>
                    <br>
                    So try to use &lt;or&gt;&lt;/or&gt; and condition
                    patterns in it.<br>
                    Something like the following:<br>
                    <br>
                      &lt;rule id="filesystem-paths-properties"&gt;<br>
                            &lt;when&gt;<br>
                                    &lt;or&gt;<br>
                                            &lt;filecontent
                    filename="{*}.{extensions}"<br>
                                                   
                    pattern="{filesystem}" /&gt;<br>
                                            &lt;filecontent
                    filename="{*}.{extensions}"<br>
                                                   
                    pattern="{netfilesystem}" /&gt;<br>
                                            &lt;filecontent
                    filename="{*}.{extensions}"<br>
                    pattern="page import="{filesystem}" /&gt;<br>
                                    &lt;/or&gt;<br>
                            &lt;/when&gt;<br>
                            &lt;perform&gt;<br>
                                    &lt;hint message="File system
                    properties" effort="1"<br>
                                    severity="mandatory"&gt;<br>
                                            &lt;message&gt;<br>
                                            TODO<br>
                                            &lt;/message&gt;<br>
                                    &lt;/hint&gt;<br>
                            &lt;/perform&gt;<br>
                            &lt;where param="extensions"&gt;<br>
                                    &lt;matches
                    pattern="(java|properties|jsp|jpsf|tag|xml|txt)"
                    /&gt;<br>
                            &lt;/where&gt;<br>
                            &lt;where param="filesystem"&gt;<br>
                                    &lt;matches pattern="(\S:[\\|/])"
                    /&gt;<br>
                            &lt;/where&gt;<br>
                            &lt;where param="netfilesystem"&gt;<br>
                                    &lt;matches
                    pattern="(\\\\ntfileserver\)" /&gt;<br>
                            &lt;/where&gt;<br>
                            &lt;where param="netfilesystem"&gt;<br>
                                    &lt;matches pattern="" /&gt;<br>
                            &lt;/where&gt;<br>
                    &lt;/rule&gt;<br>
                    <br>
                    -------- Forwarded Message --------<br>
                    Subject:        [WindUp] Regular expression to
                    detect filesystem paths<br>
                    Date:   Wed, 20 Apr 2016 15:29:03 +0200<br>
                    From:   Roman Martin Gil &lt;<a
                      moz-do-not-send="true"
                      href="mailto:rmarting@redhat.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:rmarting@redhat.com">rmarting@redhat.com</a></a>&gt;<br>
                    To:     Marek Novotny &lt;<a moz-do-not-send="true"
                      href="mailto:mnovotny@redhat.com" target="_blank">mnovotny@redhat.com</a>&gt;<br>
                    <br>
                    <br>
                    <br>
                    Hi,<br>
                    <br>
                    I am very obfuscated to create a rule to identify
                    some filesystem paths<br>
                    patterns. I am trying to detect when the code
                    (.java, .properties) have<br>
                    the following entries:<br>
                    <br>
                       * "c:\\"<br>
                       * "e:\\"<br>
                       * "c:/"<br>
                       * "e:/"<br>
                       * "\\\\ntfileserver\"<br>
                       * "page import="""<br>
                    <br>
                    <br>
                    My first approach is similar to:<br>
                    <br>
                             &lt;rule
                    id="filesystem-paths-properties"&gt;<br>
                                 &lt;when&gt;<br>
                                     &lt;filecontent
                    filename="{*}.{extensions}"<br>
                    pattern="{filesystem}" /&gt;<br>
                                 &lt;/when&gt;<br>
                                 &lt;perform&gt;<br>
                                     &lt;hint message="File system
                    properties" effort="1"<br>
                    severity="mandatory"&gt;<br>
                                         &lt;message&gt;<br>
                                             TODO<br>
                                         &lt;/message&gt;<br>
                                     &lt;/hint&gt;<br>
                                 &lt;/perform&gt;<br>
                                 &lt;where param="extensions"&gt;<br>
                                     &lt;matches
                    pattern="(java|properties|jsp|jpsf|tag|xml|txt)"
                    /&gt;<br>
                                 &lt;/where&gt;<br>
                                 &lt;where param="filesystem"&gt;<br>
                                     &lt;matches pattern="((c|e):|[\\])"
                    /&gt;<br>
                                 &lt;/where&gt;<br>
                             &lt;/rule&gt;<br>
                    <br>
                    However I am detecting cases as "Message: " as a
                    pattern. How could I<br>
                    create a rule to identify these cases?<br>
                    <br>
                    Thank you very much in advance<br>
                    <br>
                    PD: What is the better mail list to send it?<br>
                    <br>
                    <br>
                  </blockquote>
                  <br>
                </blockquote>
                <br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div><br>
                      Saludos/Best regards<br>
                    </div>
                    <div>______________________________________________________________________
                      <br>
                      <b>Jose Roman Martin Gil </b> <br>
                      <i>MW Senior Architect</i> | +34 605 926 271 | <a
                        moz-do-not-send="true"
                        href="mailto:roman.martin@redhat.com"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:roman.martin@redhat.com">roman.martin@redhat.com</a></a><br>
                      <br>
                      <i><span><span style="color:rgb(255,0,0)"><span
                              style="background-color:rgb(255,255,255)"></span></span></span></i><span
                        style="font-size:small"><span
                          style="color:#808080"><span
                            style="color:rgb(255,0,0)"><b>Red Hat</b></span>
                          Iberia <br>
                          C/ José Bardasano Baos, 9, Edif. Gorbea 3,
                          planta 3ºD, 28016 Madrid, Spain</span></span><br>
                      <span>______________________________________________________________________
                        <br>
                      </span><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>