#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    5
    Rep Power
    0

    Improve performance


    hi

    i have this regexp (m*n*)*o

    is there a way to improve it?

    thanks
  2. #2
  3. Turn left at the third duck
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Nelson, NZ
    Posts
    112
    Rep Power
    94
    Not a POSIX pro, but I guess that would depend on what you are trying to match...
    Your strings might look like this?
    mmnnmmmno
    Or do you have a "tighter spec"?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    5
    Rep Power
    0
    can be mmnnmmmno

    but can also be

    mrrrdfdnnljkjlko
  6. #4
  7. Turn left at the third duck
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Nelson, NZ
    Posts
    112
    Rep Power
    94
    Hi marcpirat,

    mrrrdfdnnljkjlko
    The best would be if you explained your spec in plain English.
    Your first post means {zero or more ms, followed by zero or more ns} zero or more times, followed by a single o.

    What you showed in your second post looks like you want an m, some ns, an o, and STUFF in between. The expression in your first post would not match that.

    Can you please explain exactly what you would like to match? Then whoever is watching the board at that time can work on translating that into a regex.

    Wishing you a fun day.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    5
    Rep Power
    0
    i want what i specified in my first post
  10. #6
  11. Turn left at the third duck
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Location
    Nelson, NZ
    Posts
    112
    Rep Power
    94
    Originally Posted by marcpirat
    i want what i specified in my first post
    Wow, good for you! In the spirit of sharing, I want laks;kj987,*&^lkjlk%$, I'm sure you understand.

    I'm trying to help you but I have no clear idea of what you're talking about---hence the questions to make you clarify your request. In my last post I tried to explain what your first post means. Is this your only comment? My neighbor bought a 4G cell phone, and as a result my psychic powers seem to be a tad scrambled at the moment.
    Last edited by ragax; February 3rd, 2012 at 05:14 PM.

IMN logo majestic logo threadwatch logo seochat tools logo