Thread: regular expression query in PERL

  1. #1
    Registered User Akhil's Avatar
    Join Date
    Feb 2003
    Posts
    14

    regular expression query in PERL

    hi all,

    I ve been working on regular expressions and thought up of a challenging(i think so) regular expression question in PERL.

    I have been wasting quite a lot of time on this now trying to find a solution, but in vain and I am sure someone in this board will def come up with the answer.

    the resular expression i am looking for should :

    *match if the characters m, e, l, v, i, n appear in a string in the same order even if there are other letters between them and regardless of the case.

    If anyone has a solution to this ..pls post a reply..

    cheers

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Code:
    /m.*e.*l.*v.*i.*n/i
    Like this?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Akhil's Avatar
    Join Date
    Feb 2003
    Posts
    14

    done!!

    yeah that will work..and that was fast reply

    Dint seem that challenging eh...

    anyways


    Since i am new to Regular expressions, what kind of regular expressions are really challenging

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    A Regular expression to match a Regular expression is a more difficult exercise
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. recursion error
    By cchallenged in forum C Programming
    Replies: 2
    Last Post: 12-18-2006, 09:15 AM
  3. Regular Expression
    By tintifaxe in forum C++ Programming
    Replies: 3
    Last Post: 06-14-2006, 07:16 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Regular Expression Troubles
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2002, 04:21 PM