0

I have the unproper data in this way. i need to extract the data before dot and after dot symbol using regular expression. I am using but i am not able to get exact data. please help. It is very urgent

Code:

Matcher matcher = Pattern.compile("([\\w[\\$#@\\-^&]\\w\\[\\]' $]+)\\.([\\w\\[\\]' $]+)").matcher(formulaData);
while (matcher.find()) 
{
String Data=matcher.group(0);
String[] pieces = Data.split("\\.");
Heading=pieces[0].replace("\"", "");
Heading=pieces[1].replace("\"", "");

 }//while
Navyah
  • 1,660
  • 10
  • 33
  • 58

1 Answers1

0

You can split by newline and then split by dot

Fran Montero
  • 1,679
  • 12
  • 24
  • yes we can split the data .. but in that data we have even sql queries – Navyah Apr 09 '15 at 08:27
  • Try this pattern: "\"\\w[\\s\\w]+\"\\.\"\\w[\\s\\w]+\""; The output produced in your code is : Table: Disti Partner , column: Disti Parent Name Table: Bookings Adjusted , column: ELA Indicator Table: Bookings Adjusted , column: ELA Cap Table: Partner Program , column: Program Tier Table: Partner Program , column: Program Tier – Fran Montero Apr 09 '15 at 11:44