Only 49 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



    Bookmark Topic Watch Topic
  • New Topic

RegEx problem  RSS feed

 
Felipe Messina
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Report post to moderator
I wanna a KeyPressEvent that fills a text field with a mask like this(999,9999).
I have to do this, using regular expression.

Can someone help me?

thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36393
453
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
First thing is to decide if you are looking for a Java or JavaScript validation. Do you want to check the format in the browser or after form submission.

Next is to define the valid values in English. Do all 6 digits need to be present?

As a hint - this matches three digits in Java - "\\d{3}"
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!