i have to search in a string like this line
"TEXT('Plan','Design',3,1.0000000E-5,#36,#37);"
and get only the pattern like [#number] and get all
then our search return #36,#37
any help ?
Printable View
i have to search in a string like this line
"TEXT('Plan','Design',3,1.0000000E-5,#36,#37);"
and get only the pattern like [#number] and get all
then our search return #36,#37
any help ?
you can use regular expression
Code:import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexDemo {
public static void main(String[] args){
String string = "TEXT('Plan','Design',3,1.0000000E-5,#36,#37);";
Pattern ex = Pattern.compile("#\\d+");
Matcher match = ex.matcher(string);
while (match.find() ){
System.out.println( match.group() );
}
}
}