<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 <where>:<br>
<br>
<filecontent filename="{*}.jsp"
pattern="import=&quot;&quot;" /><br>
<br>
<where> 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 (<%@ page import="" %>, .... 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><rule
id="jsp-empty-imports"></div>
<div><span class="" style="white-space:pre">                        </span><when></div>
<div><span class="" style="white-space:pre">                                </span><filecontent
filename="{*}.jsp" pattern="import={emptyString}" /></div>
<div><span class="" style="white-space:pre">                        </span></when></div>
<div><span class="" style="white-space:pre">                        </span><perform></div>
<div><span class="" style="white-space:pre">                                </span><hint
message="Empty imports definition in a jsp" effort="1"
severity="mandatory"></div>
<div><span class="" style="white-space:pre">                                        </span><message></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> </message></div>
<div><span class="" style="white-space:pre">                                </span></hint></div>
<div><span class="" style="white-space:pre">                        </span></perform></div>
<div><span class="" style="white-space:pre">                        </span><where
param="emptyString"></div>
<div><span class="" style="white-space:pre">                                </span><matches
pattern="(&quot;&quot;)" /></div>
<div><span class="" style="white-space:pre">                        </span></where></div>
<div><span class="" style="white-space:pre">                </span></rule></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"><<a moz-do-not-send="true"
href="mailto:ozizka@redhat.com" target="_blank">ozizka@redhat.com</a>></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>
(?<!\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" <<a moz-do-not-send="true"
href="mailto:mnovotny@redhat.com" target="_blank">mnovotny@redhat.com</a>><br>
To: "Windup-dev List" <<a moz-do-not-send="true"
href="mailto:windup-dev@lists.jboss.org"
target="_blank">windup-dev@lists.jboss.org</a>><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 <or></or> and condition
patterns in it.<br>
Something like the following:<br>
<br>
<rule id="filesystem-paths-properties"><br>
<when><br>
<or><br>
<filecontent
filename="{*}.{extensions}"<br>
pattern="{filesystem}" /><br>
<filecontent
filename="{*}.{extensions}"<br>
pattern="{netfilesystem}" /><br>
<filecontent
filename="{*}.{extensions}"<br>
pattern="page import="{filesystem}" /><br>
</or><br>
</when><br>
<perform><br>
<hint message="File system
properties" effort="1"<br>
severity="mandatory"><br>
<message><br>
TODO<br>
</message><br>
</hint><br>
</perform><br>
<where param="extensions"><br>
<matches
pattern="(java|properties|jsp|jpsf|tag|xml|txt)"
/><br>
</where><br>
<where param="filesystem"><br>
<matches pattern="(\S:[\\|/])"
/><br>
</where><br>
<where param="netfilesystem"><br>
<matches
pattern="(\\\\ntfileserver\)" /><br>
</where><br>
<where param="netfilesystem"><br>
<matches pattern="" /><br>
</where><br>
</rule><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 <<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>><br>
To: Marek Novotny <<a moz-do-not-send="true"
href="mailto:mnovotny@redhat.com" target="_blank">mnovotny@redhat.com</a>><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>
<rule
id="filesystem-paths-properties"><br>
<when><br>
<filecontent
filename="{*}.{extensions}"<br>
pattern="{filesystem}" /><br>
</when><br>
<perform><br>
<hint message="File system
properties" effort="1"<br>
severity="mandatory"><br>
<message><br>
TODO<br>
</message><br>
</hint><br>
</perform><br>
<where param="extensions"><br>
<matches
pattern="(java|properties|jsp|jpsf|tag|xml|txt)"
/><br>
</where><br>
<where param="filesystem"><br>
<matches pattern="((c|e):|[\\])"
/><br>
</where><br>
</rule><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>