Is it possible to disable regex for Output:Variable?

asked 2023-03-22 12:48:08 -0500

dhollman's avatar

updated 2023-03-23 07:58:07 -0500

It's documented that you can use regular expressions in the key value field in IDF (https://bigladdersoftware.com/epx/doc...). This was also mentioned in another question: https://unmethours.com/question/12800...

But is it possible to disable the use of regex parsing? I'm generating IDF files from other data and if that data happens to contain strings with characters used as regex operators it can end up causing errors. Since in this circumstance I know that they are not intended to be treated as regex strings it would be simplest if I could just instruct EnergyPlus to assume they are plain strings. Doing this either globally in the IDF would be ideal, or even field-by-field could work.

The reference above doesn't mention anything about this in the section I linked to or anywhere else I can find. It does link to https://github.com/google/re2/wiki/Sy... for the regex syntax being used, but I also don't see anything there which would entirely disable treating the string as a regex.

I know I can escape or replace the individual special characters but that has the disadvantage of reducing the readability of the iDF + the overhead of having to do it.

I tried using the comment syntax (?#text), but the re2 documentation states this is not supported and that seems to be the case - it did not work.

Thanks!

edit retag flag offensive close merge delete

Comments

@dhollman you may be interested in reviewing this post about adding the RegEx feature to Output:Variable objects, as well as trying to reach out to some of the users that posted comments/answers there.

Aaron Boranian's avatar Aaron Boranian  ( 2023-03-22 13:06:52 -0500 )edit

@Aaron Boranian thanks, though I had already linked to that other question in mine.

dhollman's avatar dhollman  ( 2023-03-23 07:24:38 -0500 )edit

@dhollman ha! You did indeed, well done finding that post.

Aaron Boranian's avatar Aaron Boranian  ( 2023-03-23 07:30:05 -0500 )edit