Dear all,
1. We have a string "Olympus xModel 3.1mp".. In this
string we want the REGEX to remove the chars mp (i.e.
characters appearing after 3.1) and not the "mp" that is
part of the brand Olympus.

2. We have another string "Olympus yModel 3x Zoom
Optical 5x Zoom Digital". As you can see Zoom appears
twice in this string. In this we want to remove the
words "Zoom" and also words preceding both
the "Zoom"s i.e. 3x and 5x. But before removing the 3x and
5x, we also want make sure that the word contains the
character "x" and its all other characters
are "Numeric" only. There also could be a possibility of
more "Zoom" appearing in the string. REGEX should be
applied to remove all the occurences of Zoom and the
word appearing immediately before "Zoom", provided it
contains any numbers (not necessarily 3 or 5) and character "x".


Thanks a lot.

Regards,
Habib

In reply to REGEX Help by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.