Hi I am trying to build one regex to extract 4 digit number from given string using java. I tried it in following ways:
String mydata = \"get the 0025 data f
If you want to end up with 0025,
String mydata = "get the 0025 data from string"; mydata = mydata.replaceAll("\\D", ""); // Replace all non-digits