Re: reg ex



On Wed, Apr 16, 2008 at 12:31:36AM +0100, Rob Dixon wrote:
Paul Johnson wrote:
On Tue, Apr 15, 2008 at 08:38:30PM +0100, Rob Dixon wrote:
Paul Johnson wrote:
On Wed, Apr 16, 2008 at 12:11:20AM +0530, Irfan.Sayed@xxxxxxxxxxxxx wrote:

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
That's not much of a spec. How far have you got?

Perhaps one of these possibilities will help?

$_ = "OMS.FD.08.03.000";
It was 'OMS.FD.08.03.000.14'

The original was. I was providing an (admittedly unlikely) potential
solution.

No, the object data in the original post was different from what you
coded. I don't think you meant to correct his data - that would be a
little too presumptuous :)

My point, which was obviously not well made (twice!), was that given the
minimal requirement

I need only OMS.FD.08.03.000 this much part of the string.

a sort of Reductio ad absurdum argument leads to a solution of

$_ = "OMS.FD.08.03.000";

As such I should probably have given the solution last on my list, but that
would have entailed applying some sort of likeliness ordering on the list,
which I didn't really feel like doing.

In any case, perhaps Irfan would like to clarify his intent and let us know
which particular parts of the problem are causing him problems?

Sure - the problem was understated, but all of your solutions modified
the object string when a simple regex with a capture could have provided
a solution with no side effects.

An analyst's job is to establish the problem as well as the solution,
not to invent possible problems.

You are correct. My re-reading of the original post still suggests that
modifying the string is the most likely requirement, but that's hardly
important any more. And both of us have wasted too much time on this already,
for which I apologise.

Over to you, Irfan.

--
Paul Johnson - paul@xxxxxxxx
http://www.pjcj.net
.



Relevant Pages

  • Re: Juries and accidents (Re: teaching little boys ..)
    ... >My original post wasn't intended to be insulting, ... >that statement into some sort of attack, ... I didn't see myself as escalating your ...
    (soc.singles.moderated)
  • Re: top post
    ... and several other technically-oriented groups have a tradition going back to the early days of Usenet in which people were much more concerned over bandwidth and made a conscious effort to conserve it. ... It has become sort of a not-so-secret handshake which identifies those who know the etiquette. ... I find it maddening to read digested mail lists on other topics in which someone replies, with the entire article to which they are replying at the bottom, then someone replies, in similar manner, to that message, etc. ... The result is that the messages get longer and longer while the original post is repeated _ad nauseum_, significantly making it harder to find original content. ...
    (comp.lang.c)
  • Re: Optimizing webservice call which are returning datasets
    ... are transferring... ... That sort of thing. ... client then I'm not ... But according to the original post, ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Sort Order
    ... in the Subject line brought back my original post and "Sort" in the Message ... sorted in the message body. ... Shows you old dogs can learn new tricks and very old dogs just sleep all day. ...
    (microsoft.public.windowsxp.general)
  • Re: reg ex
    ... That's not much of a spec. ... the object data in the original post was different from what you ... All of those options will modify the object string, ...
    (perl.beginners)