Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    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
Marshal
Posts: 37180
515
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: 66142
141
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!