Skip to content

STASH regular expression #2624

@ehogan

Description

@ehogan

I was just wondering whether there was a reason for using the regular expression ^\s*m(.*)s(.*)i(.*)\s*$ to determine whether a string contains a STASH code (see
https://github.com/SciTools/iris/blob/master/lib/iris/fileformats/pp.py#L308), rather than something more explicit like ^\s*m(\d{2})s(\d{2})i(\d{3})\s*$ (or even ^\s*m(\d*)s(\d*)i(\d*)\s*$)? I have a case where the string I was checking contained the netCDF variable name mlotstmin, which matches with the current regular expression, even though it is not a STASH code!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions