Ulf Dittmer wrote:Please KeepItDown. You can edit your post to fix that:
Richard Tookey wrote:Since you are "fully confused" you should spend some time learning about regular expressions. A good site to start is http://www.regular-expressions.info/tutorial.html .
P.S. I don't understand what you want to do. Are you trying to verify the pattern is correct, extract the fields or what?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Jesper de Jong wrote:So, you want to check if the input is a number in the range 1 to 31?
Regular expressions aren't very suitable for checking if a number is in a certain range. It's probably much easier and much more clear to parse the string into an int, and then check if it is within the range with a simple if-statement:
jagadeesh indukuri wrote:thanks for giving response but,
My requirement is not allowed more than 31 number value and also not consider 0 value for regex
that regex matches true then it is below 31 number otherwise i.e greater than 31 or zero itself
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Richard Tookey wrote:A basic regular expression for a single number term is...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Richard Tookey wrote:A basic regular expression for a single number term is...
Richard,
I've removed your solution because we're trying to get OP to think about it for himself. If jagadeesh does ShowSomeEffort and still has problems, then might be the time to offer a solution (with a full explanation as to why it works), but not yet, I think.
Winston
Richard Tookey wrote:I deliberately only provided a part of the overall regular expression that I suspect is needed.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |