Hi, is there a way like in perl regex, to define for example, that a string found between two identifyer groups should be assigned to a variable ?
e.g - this is the text. the rest.
get the string that is enclosed within two 'the' strings and assign it to a variable
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, is there a way like in perl regex, to define for example, that a string found between two identifyer groups should be assigned to a variable ?
e.g - this is the text. the rest.
get the string that is enclosed within two 'the' strings and assign it to a variable
Hi!
String myStr=null;
Matcher m=new Pattern("the(.*?)the").matcher("this is the text. the rest.");
if(m.find()) myStr=m.group(1);
hope this helps...