← Back to team overview

kicad-developers team mailing list archive

RegEx help

 

We have a couple of regular expressions of the form:

   wxRegEx re( ".*?\\$\\{(.+?)\\}.*?", wxRE_ADVANCED );

Now perhaps I’m too old to remember this stuff correctly, but .*? is redundant, isn’t it?

And shouldn’t .+? just be .*?  (And for that matter, shouldn’t it really be [^}]*?)

Thanks,
Jeff.


Note that I’m looking at this because it needs to check for both ${…} and $(…) formatted envvars, which I think boils down to:

.*(\\$\\{([^}]*)\\})|(\\$\\(([^)]*)\\)).*

Follow ups