I am trying to extract data between href tags in a java string. I can replace this with everything and the substring and using indexOf etc.
I would like to know how I can get data using regex.
So basically I'm trying to extract data and store it in rows or in a list.
String data ="12345"; String sampleStr =""; for(int i=0; i<10; i++) { data+=i; sampleStr += "<a href=\"javascript:yyy_getDetail(\'"+data+"\')\">"+data+"</a>"+", "; } System.out.println(sampleStr); String temp = sampleStr.substring(sampleStr.indexOf("\">")+2);
Any suggestion regarding would be appreciated. Which should be a regular expression, so I only retrieve data.
Nomad source share