<div><font face="trebuchet ms">hi yang:</font></div>
<div><br><font face="trebuchet ms">&nbsp;&nbsp;&nbsp; you can using (?!...) regex extension solve this problem. like follows:<br>#---------------------<br>$a = 'how are you today ? &quot;are you ok?&quot; you are welcome!';<br>$a =~ s/you(?!\sok\?)/hello/ig;
<br>print $a .&quot;\n&quot;;<br>#-------------------</font></div>
<div><font face="trebuchet ms">Outputs:</font></div>
<div><font face="trebuchet ms">how are hello today ? &quot;are you ok?&quot; hello are welcome!</font></div>
<div><font face="trebuchet ms">#-------------------</font></div>
<div><font face="trebuchet ms"></font>&nbsp;</div>
<div><font face="trebuchet ms"></font>&nbsp;</div>
<div><font face="trebuchet ms">other regEx extensions:</font></div>
<div><br><font face="trebuchet ms">(?= ... ) if&nbsp; match ahead successfully, return true. <br>(?!&nbsp; ... ) if&nbsp; match ahead failed, return true.<br>(?&lt;= ...) if match backwards successfully, return true.</font></div>
<div><font face="trebuchet ms">(?&lt;! ... ) if match backwards failed, return true.<br><br>Good, luck. :)</font></div>
<div><font face="trebuchet ms"></font>&nbsp;</div>
<div><font face="trebuchet ms">Havel Zhang</font></div>
<div>&nbsp;</div>
<div><span class="gmail_quote">On 8/23/06, <b class="gmail_sendername">杨晓亮</b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:yang.liana@gmail.com" target="_blank"> yang.liana@gmail.com</a>&gt; wrote:
</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<div>
<div>
<div><font face="Verdana"><font size="2">
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp; Hi, all!</font></div>
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp; suppose a src string like this: how are you today ? &quot;are you ok?&quot; you are welcome!</font></div>
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp; I want this string to be&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : how are&nbsp;hello today? &quot;are you ok?&quot; hello are welcome!</font></div>
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp; </font></div>
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp; I want to use just a regex express to do it. but i cant prevent from &quot;are you ok?&quot; being changed to be &quot;are hello ok?&quot;.</font></div>
<div><font face="Verdana" color="#0000ff" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to use the *Look ahead* or *Look behind* to solve it. can I ?</font></div>
<div><font face="Verdana" color="#000000" size="2"></font>&nbsp;</div>
<div>Yang.liana</div>
<div>Aug/23/2006</div></font></font></div></div></div><br>_______________________________________________<br>China-pm mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:China-pm@pm.org" target="_blank">
China-pm@pm.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.pm.org/mailman/listinfo/china-pm" target="_blank">http://mail.pm.org/mailman/listinfo/china-pm</a><br></blockquote></div><br>
<br clear="all"><br>-- <br>真理使你自由