Regular Expression to check numeric String
In order to build a regular expression to check if String is number or not or if String contains any non digit character or not you need to learn about character set in Java regular expression, Which we are going to see in this Java regular expression example. No doubt Regular Expression is great tool in developer arsenal and familiarity or some expertise with regular expression can help you a lot. Java supports regular expression using java.util.regex.Pattern and java.util.regex.Matchter class, you can see a dedicated package java.util.regex for regular expression in Java. Java supports regex from JDK 1.4, means well before Generics, Enum or Autoboxing. If you are writing server side code in Java programming language than you may be familiar with importance of regular expression which is key in parsing certain kind of messages e.g. FIX Messages used in Electronic trading. In order to parse Repeating groups in FIX protocolyou really needs understanding of regular expression in Java. Any way In order to learn validating numbers using regular expression we will start with simple example