import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.regex.Matcher; import java.util.regex.Pattern; public class u{ static int i=0; public static void main(String[] args) { File file=new File("File location"); try { BufferedReader br =new BufferedReader(new FileReader(file.getAbsoluteFile())); String input; StringBuilder sb=new StringBuilder(); while((input=br.readLine())!=null){ sb.append(input); } input=sb.toString(); Pattern pattern=Pattern.compile("(.*?):\\{(.*?)\\};"); Matcher matcher=pattern.matcher(input); //System.out.println(input); if(matcher.find()){ System.out.println("i"); System.out.println(matcher.group(1)); /*if(matcher.group(2)!=null){ System.out.println(matcher.group(2)); }*/ //System.out.println(matcher.group(1)); } //System.out.println(i); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)