I am trying to get a regex if-then-else expression working "correctly". Here's the scenario:
I normally have numeric data, a float, in a field of my report. Sometimes instead of numeric data I get a series of dashes (--,----). Here is my regex to try and deal with it correctly:
What I am trying to do is lookahead and see it it's a number - if so great! Capture that number (this seems to work). If it's a series of dashes then copy the dashes. What happens now is that if it's not a number, the regex query just merrily skips on to someplace else in the file and grabs that number - sometimes 6 or 8 lines later in the file. And of course this unexpected grab is the wrong data entirely. From there the regex never seems to recover correctly.
How do I check if it's a number, match if it is, or just return the dashes or a zero if it's not? A zero might be bet in the end, but dashes are in the report.