Hi,
Has anyone ever used the regular expression for a number between 0 and 65535 (FFFF), please?
6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[0-9]{1,4}
I WOULD LIKE TO SELECT A NUMBER FROM THIS RANGE BUT THE MATCH PATTERN DOESN'T RECOGNIZE IT
Solved! Go to Solution.
^(65535|[1-9]?[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
Match pattern uses a simplified function, use Match Regular expression.
Try this:
\b(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])\b
<message deleted - doesn't work for all cases>
You could also do something more simple like this:
@Fredo123Danzel wrote:
Hi,
Has anyone ever used the regular expression for a number between 0 and 65535 (FFFF), please?
6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[0-9]{1,4}
I WOULD LIKE TO SELECT A NUMBER FROM THIS RANGE BUT THE MATCH PATTERN DOESN'T RECOGNIZE IT
So you have a decimal string and would like to see if its hex formatted numeric value is in the range 0-FFFF. Can you explain what you mean by "select from this range"? Is this "number" in a fixed string position? Is it surrounded by known delimiters?
it might be easier to do things numerically.
Hi,
I would like to select: Re= 45763.
This number is between 0 and 65535.
Hi Fredo,
@Fredo123Danzel wrote:
I would like to select: Re= 45763.
What makes you think you need a RegEx here?

In case of "invalid" values after the keywords you still can use InRangeAndCoerce to check the parsed data…
He Knight OF NI,
Thank you! Your idea helped me solve my problem.
Ah, so this was a typical case of OP posting "how" they want to solve something instead of "what" they want to achieve. I assumed it was some RegExp drill ...