[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



=~ /(XMI\d\d\d)/ should work. The entire string matched will show up in 
$1 afteward. This presumes that not other characters will show in the 
string.

Its also likely that

=~ /(XMI\d+)/ or even /(XMI/d*)/ would work too (the first would match 1 
or more 'digits' the second would match 0 or more).

If you don't need to use $1 for anything, you can ditch the parens.

Mike


Chris Fowler wrote:
> I need to do a match using perl regex.  Here is the possible strings
> that will be in a stream:
> 
> XMI
> XMI001
> XMI002
> XMI###
> 
> Were the '#' could be any number.  I need to be able to detect that
> the above pattern matches in a chunk of data.  What is the correct
> regex that will fit that pattern?
> 
> Thanks,
> Chris
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
&gt; <a  rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale";>http://www.ale.org/mailman/listinfo/ale</a>

-- 

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Mike Murphy
781 Inman Mews Drive Atlanta GA 30307
Landline: 404-653-1070
Mobile: 404-545-6234
Email: mike at tyderia.net
Email Pager: pagemike at tyderia.net
AIM: mmichael453
JDAM: 33:45:14.0584N  84:21:43.038W
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00367" href="msg00367.html">[ale] Regex question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00369" href="msg00369.html">[ale] Regex question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00369.html">[ale] Regex question</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00367.html">[ale] Regex question</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00369.html">[ale] Regex question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00367.html">[ale] Regex question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00366"><strong>Date</strong></a></li>
<li><a href="threads.html#00366"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>