diff --git a/config/config.example.yml b/config/config.example.yml index 6f1a98f0..8b3429e2 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -216,7 +216,7 @@ sync_permissions: - name: thredds type: service - type: directory - regex: '(?<=:)[\w\/]+' # Match everything after ":" but before last "/" (ex: thredds:birdhouse/testdata/xclim/cmip6/sic_SImon_CCCma-CanESM5_ssp245_r13i1p2f1_2020.nc + regex: '(?<=:).*\/?(?=\/)' # Match everything after ":" but before last "/" (ex: thredds:birdhouse/testdata/xclim/cmip6/sic_SImon_CCCma-CanESM5_ssp245_r13i1p2f1_2020.nc # will match to : birdhouse/testdata/xclim/cmip6). It would be equivalent as matching any number of directory using "**". thredd_item: - name: thredds diff --git a/docs/configuration.rst b/docs/configuration.rst index 5448eefe..b9713485 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -139,10 +139,12 @@ multiple choices of matching are possible. We could match ``seg1/seg2`` with the first token, and ``seg3`` with the second token, we could also match ``seg1`` with the first token, and ``seg2/seg3`` with the second token, etc. -In addition of using the name of the segment it is possible to use instead a key found in `Magpie`_ resource schema -with the :key:`field`. This is useful when we want to be able to have a different mapping between resources. +The :key:`field` : This is useful when we want to have a different mapping between resources. The resource_name +is used by default, but another key from the `Magpie`_ resource schema can be used, if specified by using the +:key:`field`. + A regular expression :key:`regex` may be used to extract the desired information from the ``nametype_path``. -This will override the default behaviour of matching each segment with other segment and will instead use +This will override the default behaviour of matching each segment with another segment and will instead use what is extracted from the segment and prioritize the longest match. When used in the target, the :key:`regex` extracts each resource in the segment with the same type.