Yeah, that’s my favourite also.
- I don’t need to change existing code
- ptna-network.sh -g … reads the OSM-Wiki (get routes)
- ptna-network.sh -p … writes to OSM-Wiki (push routes)
- ptna-network.sh -m … modifies the read OSM-Wiki data
- does not apply here though, intended for mass-manipulation via sed -i -e …
- We will not introduce any new OSM-Wiki pages … only extend existing ones
- your script will “simulate” manual changes to the pages required after a GTFS update
- We could extend your code allowing more structure - I’m just dreaming …
- regex examples for ASCII but could apply to any UTF-8 char
- removing any match from the list of still to be printed “numbers”
- but: many people are not familiar with regex (PCRE)
@bus /^[1-9][0-9]{0,1}[^0-9]*$/
# 1 or 2 digit bus numbers go here (with optionally following letters)
@@
@bus /^1[0-9][0-9][^0-9]*$/
# 3 digit bus numbers 1.. go here for city of Munich (with optionally following letters)
@@
@bus /^2[0-9][0-9][^0-9]*$/
# 3 digit bus numbers 2.. go here for Munich county (with optionally following letters)
@@
@bus /^5[0-9][0-9][^0-9]*$/
# 3 digit bus numbers 5.. go here for Erding county (with optionally following letters)
@@
@bus /^X[1-9][0-9]$/
# Express bus in Munich
@@
@bus /^X[1-9][0-9][0-9]$/
# Express bus outside Munich
@@
@bus LHX
# exact match for a single bus (Lufthansa Express Bus), only if seen in GTFS
@@
@bus /^[A-Za-z]/
# bus "numbers" starting with ASCII letters (except those which matched in rules before)
@@
@bus
# the default, all others which have not been printed yet, like '+900', ...
@@