question about prefix and suffix in java

Posted by kate on Stack Overflow See other posts from Stack Overflow or by kate
Published on 2010-06-03T19:27:22Z Indexed on 2010/06/03 19:44 UTC
Read the original article Hit count: 170

Filed under:
|

hi!!I have an issue and i want your help!I have a specific REGEX which i have named it "unique" and i want to store the data that it gives me!! The prefix and the suffix of this regex!!so!!someone has told me to use

var prefix and

var suffix

but i don't know how to do it!

for your convinience i give u my xml for this regex

<reg name="unique">
<start><![CDATA[ <!-- 72 HOURS FORECASTS -->
]]></start>
<end><![CDATA[<!-- 72 HOURS FORECASTS -->]]></end>
</reg>

the code where i call this regex is

int k = 0;

for(Xml reg_is:fetchsite.child("site").child("regexps").children("reg")) {
    if(reg_is.string("name").contains("unique")){


        if(reg_is.child("start").content()=="")
            error += "\tNo prefix reg.exp. given.\n";

        else
              prefix = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("start").content()));                     

        if(reg_is.child("end").content()=="")
            error += "\tNo suffix reg.exp. given.\n";
        else
                suffix = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content()));

    }
    else{
          poleis[k][0]= HtmlMethods.removeBreaks(reg_is.string("name"));
          poleis[k][1] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("start").content())); 
          poleis[k][2] = HtmlMethods.removeBreaks(replaceVariables(reg_is.child("end").content()));

           k++;
 }

© Stack Overflow or respective owner

Related posts about java

Related posts about Xml