2013年9月10日星期二

Help regex



Will external json content inside this extract how ah ? Thank you
------ Solution -------------------------------------- ------

Pattern p = Pattern.compile ("external ["] (. * ? ) [ " ] " ) ;
Matcher m = p.matcher (str);

while (m.find ()) {
ccc = m.group ();
}
try it yourself
------ Solution --------------------------------- -----------
external \ "(. *?) \"> try removing the brackets
------ Solution ----- ---------------------------------------
 while (m.find()) {
            System.out.println(m.group());
        }


certainly more
------ For reference only ------------------------------ ---------


I try, first try a
------ For reference only -------------------------- -------------
tried it did not respond to it , I was not wrong ? You look at the code I posted
public List
/ /
System.out.println (" Table Name :" + tabkey + "-" + frmKey);
System.out.println (content);



Pattern p = Pattern.compile ("external [\"] (. *?) [\ "]");
Matcher m = p.matcher (content);

String ccc = "";

while (m.find ()) {
ccc = m.group ();
System.out.println (ccc + "-");
}
------ For reference only ----------------- ----------------------

or not Pattern p = Pattern.compile ("external \" (. *?) \ "");
------ For reference only ---------------------------- -----------
is not less write a equal sign ?
------ For reference only -------------------------------------- -
write can Pattern p = Pattern.compile ("external = \" (. *?) \ ""); is to add the equal sign , but I have this external there may be multiple , so just take out the one to take it
------ For reference only ------------------------ ---------------


I just used it , just take out the last one

------ For reference only ---------------------------------- -----
out, that is the way to write
public List
/ /
System.out.println (" Table Name :" + tabkey + "-" + frmKey);
System.out.println (content);

Pattern p = Pattern.compile ("external = \" (. *?) \ "");
Matcher m = p.matcher (content);

while (m.find ()) {
/ / ccc = m.
System.out.println (m.group () + "-");

}
return null;
}
------ For reference only --------------------------------- ------


Why ccc = m.group (); instead of many it ?
------ For reference only -------------------------------------- -
with jsoup Find a span element on the line and then take the attribute

没有评论:

发表评论