APSIMInitiative / ApsimX

ApsimX is the next generation of APSIM
http://www.apsim.info
Other
134 stars 162 forks source link

Characters in the path in the json file #6381

Closed byzheng closed 3 years ago

byzheng commented 3 years ago

I am writing a regular expression to remove the last node of a path, for example, remove LV from [Phenology].CAMP.FLNparams.LV to obtain [Phenology].CAMP.FLNparams.

My current regular expression is ^(.+)\\.([a-zA-Z0-9]+)$. Do any special characters allow in the node name?

hol430 commented 3 years ago

When typing names into the gui, we only allow letters, numbers and underscores in the model/node names. However by opening the .apsimx file in a text editor someone could type in anything they want. Also if the file is imported from old apsim, then it can have non-alphanumeric characters. I'm not sure what exactly old apsim allows but I've definitely seen hyphens and plus signs.

byzheng commented 3 years ago

Thanks @hol430. That's enough information for my current task.