I am trying to extract phone number in java from the given String i.e. the phone number can be anywhere in the String like [bla bla]TELEPHONE NUMBER[bla bla]
.Now I
To find number in any given format You can use use libphonenumber and findNumbers function.
Assuming your regular expression works as it should, you should take a look at this regex tutorial from Sun.
Pattern p = Pattern.compile("^[a-zA-Z]+([0-9]+).*"); Matcher m = p.matcher("Testing123Testing"); if (m.find()) { System.out.println(m.group(1)); }