regular expression query in PERL

This is a discussion on regular expression query in PERL within the Tech Board forums, part of the Community Boards category; hi all, I ve been working on regular expressions and thought up of a challenging(i think so) regular expression question ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,752
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,752
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 03: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, 08:16 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 11:03 AM
  5. Regular Expression Troubles
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2002, 05:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21