Regex Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreRegex Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 2nd, 2012, 08:24 AM
marcpirat marcpirat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 5 marcpirat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
POSIX - Improve performance

hi

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

is there a way to improve it?

thanks

Reply With Quote
  #2  
Old February 2nd, 2012, 06:30 PM
ragax's Avatar
ragax ragax is offline
Turn left at the third duck
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Location: Nelson, NZ
Posts: 93 ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 24 m 37 sec
Reputation Power: 92
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"?
__________________
Regex Tutorial | Latest RegexBuddy Demo

Reply With Quote
  #3  
Old February 3rd, 2012, 12:55 AM
marcpirat marcpirat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 5 marcpirat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
can be mmnnmmmno

but can also be

mrrrdfdnnljkjlko

Reply With Quote
  #4  
Old February 3rd, 2012, 04:22 AM
ragax's Avatar
ragax ragax is offline
Turn left at the third duck
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Location: Nelson, NZ
Posts: 93 ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 24 m 37 sec
Reputation Power: 92
Hi marcpirat,

Quote:
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.

Reply With Quote
  #5  
Old February 3rd, 2012, 03:00 PM
marcpirat marcpirat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 5 marcpirat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 34 sec
Reputation Power: 0
i want what i specified in my first post

Reply With Quote
  #6  
Old February 3rd, 2012, 04:07 PM
ragax's Avatar
ragax ragax is offline
Turn left at the third duck
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2011
Location: Nelson, NZ
Posts: 93 ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level)ragax User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 24 m 37 sec
Reputation Power: 92
Quote:
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 04:14 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreRegex Programming > POSIX - Improve performance

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap