I need to read a string from the paragraph which has format of "abc.xyz" format. I am very new for regular expression and i am stucked hear to read the format, please can any one help me out to get the data example:
Calendar_year_lookup.Yr,Outlet_Lookup.Shop_name,Article_lookup.Category, Article_lookup.Sale_price, sum(Shop_facts.Quantity_sold)
Output:
Calendar_year_lookup.Yr
Outlet_Lookup.Shop_name
Outlet_Lookup.Shop_name
Article_lookup.Sale_price
Shop_facts.Quantity_sold
code:
public static void main(String[] args)
{
// TODO Auto-generated method stub
String data="Calendar_year_lookup.Yr,Outlet_Lookup.Shop_name,Article_lookup.Category, Article_lookup.Sale_price, sum(Shop_facts.Quantity_sold)";
//data.matches("\w\.\w");
Pattern pattern = Pattern.compile("\\p{L}+[.]\\p{L}+");
Matcher matchers=pattern.matcher(data);
//System.out.println(matchers);
if(matchers.find())
{
System.out.println(matchers.group(0));
}
}