Thinking out loud...the solution would have to dynamically invoke the length of a submatch as a quantifier, or count its occurrences, neither of which seems to be allowed.
Or you could cheat and check for every power less than n, in a massive alternation, by building a custom regex before the match.
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re: check for power of a number with regex
by QM
in thread check for power of a number with regex
by spx2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |