<?xml version="1.0" encoding="windows-1252"?>
<node id="1006098" title="Wild card in regular expression" created="2012-11-28 15:59:58" updated="2012-11-28 15:59:58">
<type id="115">
perlquestion</type>
<author id="757569">
sathya_myl</author>
<data>
<field name="doctext">
&lt;p&gt;I am trying to replace a single character in a word with wild character and ended up with error&lt;/p&gt;

&lt;p&gt;Here is my code&lt;/p&gt;

&lt;code&gt;
my $test = "Here is the there";
$test =~s/(ther*)/\&lt;test\&gt;$1\&lt;\/test\&gt;/ig;
print "$test\n";
&lt;/code&gt;

&lt;p&gt; The output is "Here is &lt;test&gt;the&lt;/test&gt; &lt;test&gt;the&lt;/test&gt;re"&lt;/p&gt;

&lt;p&gt;But the expected output is "Here is the &lt;test&gt;there&lt;/test&gt;&lt;/p&gt;


&lt;p&gt;My intention is this * need to represent a character after the string ther.&lt;/p&gt;</field>
</data>
</node>
