The output should be either a value of 1 for a numeric match, or a value of 0 when the numeric match fails.
Could I have missed some variations, and are there grounds for improvement ?
Have been looking at the Format-Control Letters (OFMT) in awk for a feeling on tho various numeric formats, initially looking at %d, %i, %f, %e, and %E.
I will be using a slight modification to it, so I can determine whether a numeric value is valid (e.g. do a check before using numerical values in sed commands, so as not to introduce security vulnerabilities), whether a number is positive or negative. Finally the positivity and negativity checks will be used to round numerical values.
+ is a quantifier resp. meta charachter, when not inside a bracket expression. It needs a preceeding element, so in the 2nd case you're searching for one or more line beginnings (what obviously doesn't make much sense and should give an error) and not for a literal plus sign. Instead of surrounding it by brackets, it could also be escaped with a backslash so that it loses its special meaning.
How do you define problems?
This regex has been given in another thread of yours with some explained caviats.
You have to be more specific and reference the priously provided suggestions and the corresponding thread ...
awk natively understands decimal exponent (scientific) notation. The task is to match the decimal exponent notation, in all its variations. Initially it was based on what bc could produce.
as always, give your sample input, what's the expected output?
What's your awk (sounds you're implying the awk usage) look like?
Did you look at the updates to your previous thread?
Is not what you're looking for?
I have updated the question to something more meaningful. I now realise it was indeed your suggestion to beef things up. Do we really require the ?: before [eE] ? Did not understand its purpose well.
your update of the first post in this thread is still vague.
I see the input, what's the desired out?
What's your code? I see a regex that's been modified from its original, but what tool is it for? sed/awk/grep/python/somethingElse?
What IS your question?
?: before [eE] is a PCRE (lookup in the other thread what it stands for) is an optional look-ahead. This functionality is not provided by either sed or awk, but ** is provided by Linux grep with -P flag.
You are right. (?: ... ) doesn't mean anything special in POSIX BRE or ERE, which are the regular expression languages used by Bash and typical Unix tools. Why do we want Perl-Compatible Regular Expressions ?
You are right, too.
A look-behind and look-ahead can only make sense when there is a reference to the actual match.
Like in perl with a substitution.
In grep I can only think of a reference when there is the -o option. Otherwise the full matching line is printed. Eventually it reduces the colored portion if output goes to a terminal (a "feature" that is a bit mysterious to me sometimes).