Re: reg ex
- From: paul@xxxxxxxx (Paul Johnson)
- Date: Tue, 15 Apr 2008 21:03:47 +0200
On Wed, Apr 16, 2008 at 12:11:20AM +0530, Irfan.Sayed@xxxxxxxxxxxxx wrote:
Hi All,
Hello
I need help in regular expression. I have string as follows.
OMS.FD.08.03.000.14
I need only OMS.FD.08.03.000 this much part of the string.i want to
exclude .14
Please help.
That's not much of a spec. How far have you got?
Perhaps one of these possibilities will help?
$_ = "OMS.FD.08.03.000";
s/.14//;
s/\.\d+$//;
s/\..*$//;
s/^((?:[^.*]\.){4}[^.]*).*/$1/;
--
Paul Johnson - paul@xxxxxxxx
http://www.pjcj.net
.
- Follow-Ups:
- Re: reg ex
- From: Rob Dixon
- Re: reg ex
- Prev by Date: Re: grabbing text between two tokens
- Next by Date: Re: reg ex
- Previous by thread: blessing a hash
- Next by thread: Re: reg ex
- Index(es):