hi friends.. in my application i have number of days field. it Should not allow user to input special characters in the field.and it Should not allow blank space in the Number of Days field. what regular expression can i use... Thanks a lot -- Posted via http://www.ruby-forum.com/.
\d+ On Jun 19, 2009, at 10:44 PM, Newb Newb wrote:> > hi friends.. > in my application i have number of days field. > it Should not allow user to input special characters in the > field.and it > Should not allow blank space in the Number of Days field. > what regular expression can i use... > Thanks a lot > -- > Posted via http://www.ruby-forum.com/. > > >
Perhaps it''s best if you try, and then if you fail ask the question? Otherwise you will be asking on the list everytime you need a regular expression I recomment the following http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ Simon On Sat, 20 Jun 2009 13:44:15 +0800, Newb Newb <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi friends.. > in my application i have number of days field. > it Should not allow user to input special characters in the field.and it > Should not allow blank space in the Number of Days field. > what regular expression can i use... > Thanks a lot
Simon Macneall wrote:> Perhaps it''s best if you try, and then if you fail ask the question? > Otherwise you will be asking on the list everytime you need a regular > expression > > I recomment the following > http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ > > Simon > > On Sat, 20 Jun 2009 13:44:15 +0800, Newb NewbSorry for my ignorance,,,, actually i tried but i dont know how limit the input upto two digits... that is i Should limit the input to two digits in the field. it should accept 20 and 5 but not 120... that s my confusion... Thanks for ur Reply -- Posted via http://www.ruby-forum.com/.
Is it possible to limit the input upto two digits using regex -- Posted via http://www.ruby-forum.com/.
1. Please refrain from bumping your topic so often, you clearly stated your request in a previous post, there is no need to repost with no added information 10 minutes later. The only thing you might achieve is to deter people that may help you. 2. Most people here don''t mind helping people who are obviously stuck, but will mostly ignore those who are blatantly lazy and don''t even care to read the links given them. Am 20.06.2009 um 08:18 schrieb Newb Newb:> Is it possible to limit the input upto two digits using regex3. Which brings me to the point: Have you even read _in full_ the link Simon gave you? There is a box called "Quantifiers", with which you can specify the number of occurrences of a certain pattern in your regex. Please go read up on that, or for that matter on any of the top results google yields for "ruby regex" or something like that, and if you still have problems understanding what is written there, come back and ask, if you are just too lazy to make even that little bit of research for yourself, then please stay away from this forum, thank you. Felix