<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=557405916-28062006><FONT face=Arial
color=#0000ff size=2>This one works for those situations where you are not sure
what will be between the occurences of the character you are trying to replace.
It is only any good for single character replaces though as it is
below.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=557405916-28062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=557405916-28062006><FONT face=Arial
color=#0000ff size=2>$string =~ s/^([^?]*\?[^?]*\?[^?]*)(\?)(.*)$/\1to_date(?,
'YYYY-MM-DD HH24:MI:SS')\3/;</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
sanfrancisco-pm-bounces+adam.morgan=safeway.com@pm.org
[mailto:sanfrancisco-pm-bounces+adam.morgan=safeway.com@pm.org] <B>On Behalf Of
</B>Loo, Peter # PHX<BR><B>Sent:</B> Wednesday, June 28, 2006 9:19
AM<BR><B>To:</B> San Francisco Perl Mongers User Group<BR><B>Subject:</B>
[sf-perl] Quick question on regular expression and
substitution<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New" size=2>Hi
All,</FONT></SPAN></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New" size=2>Would some
one know of a one liner that would replace the third occurrence of a substring
within a string? For example:</FONT></SPAN></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New" size=2>$string =
"?, ?, ?, ?";</FONT></SPAN></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New" size=2>I want to
replace the third occurrence of "?" with "to_date(?, 'YYYY-MM-DD
HH24:MI:SS')".</FONT></SPAN></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New" size=2>Thanks in
advance.</FONT></SPAN></DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=132431416-28062006><FONT face="Courier New"
size=2>Peter</FONT></SPAN></DIV>
<DIV> </DIV></BODY></HTML>
<P>"MMS <safeway.com>" made the following annotations.<br>
------------------------------------------------------------------------------<br>
Warning: <br>
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. <br>
<br>
==============================================================================<br>
</P>