<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Bien vu ! J'ai pu modifier en conséquence la règle pour le tag
mapillary sur <a class="moz-txt-link-freetext" href="https://josm.openstreetmap.de/wiki/Rules/Pictures">https://josm.openstreetmap.de/wiki/Rules/Pictures</a><br>
</p>
<pre class="moz-signature" cols="72">Adrien P.</pre>
<div class="moz-cite-prefix">Le 05/11/2019 à 12:39, Yves P. a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:3E86D05A-1C66-4BEC-BAB0-4595EC160110@gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div>Bonjour,</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">Le 3 nov. 2019, PanierAvide a écrit :</div>
<br class="Apple-interchange-newline">
<div class="">
<p style="caret-color: rgb(0, 0, 0); font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration: none;"
class="">Sur le modèle du fichier MapCSS pour les tags
Wikimedia, on peut ajouter une règle avec un
"regexp_match" pour rechercher/remplacer automatiquement.
Pour une raison qui m'échappe, la règle suivante qui
devrait faire le boulot ne fonctionne pas (pour tester,
créer un nœud avec le tag mapillary=<a
class="moz-txt-link-freetext"
href="https://www.mapillary.com/app/?lat=49.18298900000002&lng=-2.1090169999999944&z=17&pKey=XCcwknc5F9zgqs6GKBUFig"
moz-do-not-send="true">https://www.mapillary.com/app/?lat=49.18298900000002&lng=-2.1090169999999944&z=17&pKey=XCcwknc5F9zgqs6GKBUFig</a><span
class="Apple-converted-space"> </span>) :<br class="">
</p>
<p style="caret-color: rgb(0, 0, 0); font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration: none;"
class=""><code class="">*[mapillary][mapillary!~/^[a-zA-Z0-9_-]{22}$/][mapillary=~/pKey=[a-zA-Z0-9_-]{22}/]
{</code><code class=""><br class="">
</code><code class=""> throwError: tr("mapillary tag
should only contain image ID instead of full URL");</code><code
class=""><br class="">
</code><code class=""> fixAdd: concat("mapillary=",
get(regexp_match("pKey=([a-zA-Z0-9_-]{22})",
tag("mapillary")),1));</code><code class=""><br class="">
</code><code class="">}</code></p>
<p style="caret-color: rgb(0, 0, 0); font-family: Helvetica;
font-size: 12px; font-style: normal; font-variant-caps:
normal; font-weight: normal; letter-spacing: normal;
text-align: start; text-indent: 0px; text-transform: none;
white-space: normal; word-spacing: 0px;
-webkit-text-stroke-width: 0px; text-decoration: none;"
class="">Si un expert JOSM/MapCSS peut nous éclairer
là-dessus... :-)</p>
<div class=""><br class="">
</div>
</div>
</blockquote>
En fait, c’est comme si il manquait le flag « g ».</div>
<div>L’expression « <b class="">pKey=(.*)</b> » ne fonctionne pas,
mais « <b class="">.*pKey=(.*).* </b>» oui !!</div>
<div><br class="">
</div>
<div>La <a
href="https://josm.openstreetmap.de/wiki/Help/Styles/MapCSSImplementation"
class="" moz-do-not-send="true">doc</a> parle de flag i, m ou
s.</div>
<div><span style="background-color: rgb(255, 255, 255);" class=""><font
class="" size="2" face="Verdana, Arial, Bitstream Vera Sans,
Helvetica, sans-serif">Flags is a string that may contain
"i" (case insensitive), "m" (multiline) and "s" ("dot all »)</font></span></div>
<div><span style="background-color: rgb(255, 255, 255);" class=""><font
class="" size="2" face="Verdana, Arial, Bitstream Vera Sans,
Helvetica, sans-serif">Idem pour </font></span><a
href="https://josm.openstreetmap.de/doc/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.html#regexp_match-java.lang.String-java.lang.String-java.lang.String-"
class="" moz-do-not-send="true">Javadoc</a></div>
<div><br class="">
</div>
<div>Il y a plus de flags décrit <a
href="https://josm.openstreetmap.de/doc/org/openstreetmap/josm/gui/mappaint/mapcss/Functions.html#regexp_match-java.lang.String-java.lang.String-java.lang.String-"
class="" moz-do-not-send="true">ici</a> : </div>
<dl style="caret-color: rgb(53, 56, 51); color: rgb(53, 56, 51);
font-family: "DejaVu Sans", Arial, Helvetica,
sans-serif; background-color: rgb(255, 255, 255);" class="">
<dd style="margin: 5px 0px 10px; font-family: "DejaVu Sans
Mono", monospace;" class=""><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">flags</code> -
Match flags, a bit mask that may include <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#CASE_INSENSITIVE"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">CASE_INSENSITIVE</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#MULTILINE"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">MULTILINE</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#DOTALL"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">DOTALL</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#UNICODE_CASE"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">UNICODE_CASE</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#CANON_EQ"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">CANON_EQ</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#UNIX_LINES"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">UNIX_LINES</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#LITERAL"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">LITERAL</code></a>, <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#UNICODE_CHARACTER_CLASS"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">UNICODE_CHARACTER_CLASS</code></a> and <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html#COMMENTS"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top: 4px;
margin-top: 8px; line-height: 1.4em;" class="">COMMENTS</code></a></dd>
</dl>
<div class="">Le flag g de Perl est implicite d’après la doc :</div>
<div class="">
<ul style="caret-color: rgb(71, 71, 71); color: rgb(71, 71, 71);
font-family: "DejaVu Serif", Georgia, "Times
New Roman", Times, serif; font-size: 14px;" class="">
<li class="">
<p class="">Perl uses the <tt style="font-family:
"DejaVu Sans Mono", monospace; padding-top:
4px; margin-top: 8px; line-height: 1.4em;" class="">g</tt> flag
to request a match that resumes where the last match left
off. This functionality is provided implicitly by the <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html"
title="class in java.util.regex" style="text-decoration:
none; color: rgb(74, 103, 130);" class=""
moz-do-not-send="true"><code style="font-family:
"DejaVu Sans Mono", monospace; padding-top:
4px; margin-top: 8px; line-height: 1.4em;" class="">Matcher</code></a> class:
Repeated invocations of the <a
href="https://docs.oracle.com/javase/8/docs/api/java/util/regex/Matcher.html#find--"
style="text-decoration: none; color: rgb(74, 103, 130);"
class="" moz-do-not-send="true"><code
style="font-family: "DejaVu Sans Mono",
monospace; padding-top: 4px; margin-top: 8px;
line-height: 1.4em;" class="">find</code></a> method
will resume where the last match left off, unless the
matcher is reset.</p>
</li>
</ul>
<div class="">C’est comme si l’expression régulière était
évaluée différemment par regexp_match et MapCSS ??</div>
</div>
<div class=""><br class="">
</div>
<div class="">—</div>
<div class="">Yves</div>
<div class=""><br class="">
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Talk-fr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Talk-fr@openstreetmap.org">Talk-fr@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/talk-fr">https://lists.openstreetmap.org/listinfo/talk-fr</a>
</pre>
</blockquote>
</body>
</html>