<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;"><div>Dear all,<br><br>i have this function:<br>

        
                <div style="font-family: arial,helvetica,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><style>#cg_msg_content #cg_msg_content #cg_msg_content .c9Y6TC { color: rgb(0, 0, 255); }#cg_msg_content #cg_msg_content #cg_msg_content .c50HZ4 { color: rgb(0, 128, 128); }</style>
        
<span class="c9Y6TC">declare</span> <span class="c9Y6TC">function</span> local:Match($X <span class="c9Y6TC">as</span> xs:string<span class="c50HZ4">*</span>,$Y <span class="c9Y6TC">as</span> xs:string<span class="c50HZ4">*</span>)<br>
{<br>
        <br>

        
                <style>#cg_msg_content #cg_msg_content #cg_msg_content .c9Y6TC { color: rgb(0, 0, 255); }#cg_msg_content #cg_msg_content #cg_msg_content .c50HZ4 { color: rgb(0, 128, 128); }#cg_msg_content #cg_msg_content #cg_msg_content .c4ZSSG { color: rgb(128, 0, 128); }</style>
        
<span class="c9Y6TC">let</span> $count<span class="c50HZ4">:=</span>tokenize($X, <span class="c4ZSSG">"\s"</span>)
        <br>

        
                <style>#cg_msg_content #cg_msg_content #cg_msg_content .c9Y6TC { color: rgb(0, 0, 255); }#cg_msg_content #cg_msg_content #cg_msg_content .c4ZSSG { color: rgb(128, 0, 128); }#cg_msg_content #cg_msg_content #cg_msg_content .cPA8 { color: rgb(0, 128, 0); }</style>
        
<span class="c9Y6TC">where</span> <br>
<span class="c9Y6TC">some</span>  $l <span class="c9Y6TC">in</span> $count <span class="c9Y6TC">satisfies</span> <br>
<span class="c9Y6TC">some</span> $tok2 <span class="c9Y6TC">in</span> tokenize($Y, <span class="c4ZSSG">"\s"</span>) <span class="c9Y6TC">satisfies</span><br>
contains($l,$tok2)<br>
<span class="c9Y6TC">return</span> true()<br>
        }<br><br><div>it's ok , it return true where $X exist in $Y<br>but the problem is: supposing i have:<br><span style="font-weight: bold;">$string1</span>='an '<br><span style="font-weight: bold;">$string2</span>= 'the xquery is a language for xml'<br><br>this function will return&nbsp; true because '<span style="font-weight: bold;">an</span>' exist in the word <span style="font-weight: bold;">'language'</span><br>but i want to know how to return true only if the word '<span style="font-weight: bold;">an</span>' exit alone , not in other word of <span style="font-weight: bold;">$string2</span><br><br>i hope you understand me.<br>thank you<br></div>
</div>




<br></div>
</div><br>




      </body></html>