Opened 6 years ago

Last modified 6 years ago

#18301 closed defect

Regex in regexp_match are not handled like regex in MapCSS rules — at Version 1

Reported by: pyrog Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc:

Description (last modified by Don-vip)

What steps will reproduce the problem?

See https://josm.openstreetmap.de/wiki/Rules/Pictures

MapCSS rule select all objects with value containing pKey=xxxxx

*[mapillary][mapillary!~/^[a-zA-Z0-9_-]{22}$/][mapillary=~/**pKey=[a-zA-Z0-9_-]{22}**/] {

Same regex don't match

regexp_match("**pKey=([a-zA-Z0-9_-]{22}**)", tag("mapillary"))

But this one, yes

regexp_match("**.*pKey=([a-zA-Z0-9_-]{22}).***", tag("mapillary"))

This like if regexp_match don't have the Perl regex flag g.

(But the doc say that this "flag" is implicit)

Perl uses the g flag to request a match that resumes where the last match left off. This functionality is provided implicitly by the Matcher class: Repeated invocations of the find method will resume where the last match left off, unless the matcher is reset.

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2019-11-06 00:36:45 +0100 (Wed, 06 Nov 2019)
Build-Date:2019-11-06 02:30:56
Revision:15519
Relative:URL: ^/trunk

Identification: JOSM/1.5 (15519 fr) Mac OS X 10.14.6
OS Build number: Mac OS X 10.14.6 (18G95)
Memory Usage: 1428 MB / 1820 MB (309 MB allocated, but free)
Java version: 1.8.0_221-b11, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: Display 69732928 1280x800
Maximum Screen Size: 1280x800
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/31/583aa85f-4a297e61, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM (development version), -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-72a21903.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm-latest.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ CADTools (1008)
+ PicLayer (35104)
+ SeaMapEditor (34908)
+ apache-commons (35092)
+ apache-http (34908)
+ cadastre-fr (35194)
+ ejml (35122)
+ geotools (35169)
+ jaxb (35014)
+ jna (34908)
+ jts (35122)
+ opendata (35179)
+ reverter (35084)
+ tag2link (35149)
+ utilsplugin2 (35177)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Towers&zip=1
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Telecom&zip=1

Validator rules:
+ https://github.com/Jungle-Bus/transport_mapcss/raw/gh-pages/transport.validator.zip
+ ${HOME}/Downloads/Rules_Pictures.validator.mapcss

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- W: Region [TMS_BLOCK_v2] Resetting cache
- E: Error header: Version mismatch: Provided 5, server had: 6 of Node 4596808640
- E: Conflits détectés - <html>L’envoi<strong>a échoué</strong> car le serveur possède une version plus récente<br>d’un nœud, chemin ou relation.<br>Le conflit a pour origine le <strong>nœud</strong> avec l’identifiant <strong>4 596 808 640</strong>,<br>le serveur possède la version 6, votre version est 5.<br><br>Cliquez sur <strong>Synchroniser le nœud 4 596 808 640</strong> pour synchroniser uniquement l’objet en conflit.<br>Cliquez sur <strong>Synchroniser tout le jeu de données</strong> pour synchroniser tout le jeu de données.<br>Cliquez sur <strong>Annuler</strong> pour annuler et continuer.<br></html>
- W: Conflits détectés - <html>2 conflits ont été détectés.</html>
- W: Aucunes coordonnées valides n’ont été trouvées

Change History (1)

comment:1 by Don-vip, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.