Sairam Sairam - 1 year ago 56
Java Question

Regex pattern For alphanumerics,//,* and decimal points up to 2 points

I want to match a text which has alphanumerics, slash (

), asterisk (
) and decimal (
) up to two points like
but not

I have tried
I have Just kept
which is accepting everything. but it shouldn't be like that. It should be something like (./d{2}) for accepting only 2 digits after decimal(.)

Example of what I want to match:


Answer Source

This matches the string you provided in the comments:


Try it here

Make sure when you put it in your Java code to escape all the backslashes:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download