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, 2009, 04:40 PM
Weekend Coder Weekend Coder is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Tacoma, WA
Posts: 199 Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Days 10 h 34 m 53 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Problem with expression

I need to find:

"{SomeString ...anything goes here... }"

Where the streing starts out with "{SomeString" and ends with "}", but can have anything in between.

I would be using preg_replace...

I'm not getting anywhere.

Reply With Quote
  #2  
Old February 2nd, 2009, 08:59 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,682 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 2 h 35 m 32 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Anything... except a } of course. Remember that.

{ and } are special characters: escape them with a backslash. Use [] for a set, then negate it, and include whatever character you don't want. A * means "any number of" - use that on the character set.

Reply With Quote
  #3  
Old February 3rd, 2009, 03:42 PM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by requinix
...

{ and } are special characters...


... in some cases.
See: http://www.regular-expressions.info...rs.html#special

Reply With Quote
  #4  
Old February 4th, 2009, 12:06 AM
Weekend Coder Weekend Coder is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Tacoma, WA
Posts: 199 Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Days 10 h 34 m 53 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
How about this:
Code:
$pattern = '/\{SomeString\s*[0-9a-fA-F\s]\}/';
to match "Opening Curly Brace + SomeString + Space Char + Any Number of Letters and Numbers and Space Chars + Closing Curly Brace"

Reply With Quote
  #5  
Old February 4th, 2009, 10:08 AM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by Weekend Coder
How about this:
Code:
$pattern = '/\{SomeString\s*[0-9a-fA-F\s]\}/';
to match "Opening Curly Brace + SomeString + Space Char + Any Number of Letters and Numbers and Space Chars + Closing Curly Brace"


Try it!

Reply With Quote
  #6  
Old February 4th, 2009, 10:11 AM
Weekend Coder Weekend Coder is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Tacoma, WA
Posts: 199 Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Days 10 h 34 m 53 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by prometheuzz
Try it!
I'm not sitting at a machine that has development software installed. Any friendly knowledgeable folks?

Reply With Quote
  #7  
Old February 4th, 2009, 10:21 AM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by Weekend Coder
I'm not sitting at a machine that has development software installed. Any friendly knowledgeable folks?


What good would it do you if someone here would say "yes that is correct". You will still need to wait when you you get to a system that has the right software to test it yourself. Right?
Also, when performing an extensive test yourself, you might run into a corner case that you didn't mention here. What if someone here says: "yes, that is the correct regex" and you don't test it properly and therefore don't run into this corner case?

But yeah, what you said in your post, is more or less correct. I said "more or less" because \s matches not only single white spaces, but also new lines, tabs, etc. But again: test it yourself!

Note that you can also test your regex-es online. Just Google for "on line regex tester". This one is nice:
http://regex.larsolavtorvik.com/

Good luck!

Reply With Quote
  #8  
Old February 4th, 2009, 10:22 AM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by Weekend Coder
I'm not sitting at a machine that has development software installed. Any friendly knowledgeable folks?


B.t.w, are you insinuating something with the cursive word "friendly"?

Reply With Quote
  #9  
Old February 4th, 2009, 10:59 AM
Weekend Coder Weekend Coder is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Tacoma, WA
Posts: 199 Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Days 10 h 34 m 53 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by prometheuzz
B.t.w, are you insinuating something with the cursive word "friendly"?
Yes I am.

If you're unwilling to be helpful, why waste your time? Your attitude is very unfriendly.

I made an effort to work it out and asked if it looked good. If you didn't care to waste your time, you should have skipped commenting at all.

This is *NOT* some IRC channel.

And, EVEN if it does work, maybe there is a BETTER way to do what I want?

But clearly you are NOT a helpful person.

Last edited by Weekend Coder : February 4th, 2009 at 11:03 AM.

Reply With Quote
  #10  
Old February 4th, 2009, 12:31 PM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by Weekend Coder
Yes I am.

If you're unwilling to be helpful, why waste your time? Your attitude is very unfriendly.

I made an effort to work it out and asked if it looked good. If you didn't care to waste your time, you should have skipped commenting at all.

This is *NOT* some IRC channel.

And, EVEN if it does work, maybe there is a BETTER way to do what I want?

But clearly you are NOT a helpful person.


So by telling you to try something, I am unfriendly? What an ungrateful piece of work you are!
I wasn't unfriendly to you. I didn't know you had no machine at hand where you could test it. And after you explained why you couldn't test it, didn't I gave you a proper explanation and didn't I explain why I suggested you to test it yourself?

I won't waste my time on you anymore!

Last edited by prometheuzz : February 4th, 2009 at 01:34 PM.

Reply With Quote
  #11  
Old February 4th, 2009, 12:57 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,682 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 2 h 35 m 32 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Guys, knock it off. You've both insulted each other thoroughly so call it even.

Reply With Quote
  #12  
Old February 4th, 2009, 01:35 PM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by requinix
Guys, knock it off. You've both insulted each other thoroughly so call it even.


Ah, I see, to make a point, you have to increase the size of your font. Good to know.

Granted, my last remark was not necessary (I removed it), but I still find the OP and ungrateful piece of work for calling me unhelpful

Reply With Quote
  #13  
Old February 4th, 2009, 02:40 PM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
I also find it disappointing that people don't seek the discussion but rather "vote" me down using this forum's voting system. The easy way out, if you ask me.
A shame.

Reply With Quote
  #14  
Old February 4th, 2009, 02:42 PM
prometheuzz prometheuzz is offline
User 165270
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 497 prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level)prometheuzz User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 5 Days 10 h 14 m 35 sec
Reputation Power: 936
Quote:
Originally Posted by requinix
Anything... except a } of course. Remember that.

{ and } are special characters: ...


I was mild earlier. The above statement is false: '{' and '}' are not special characters. In some cases '{' is a special character but '}' is never one.

Reply With Quote
  #15  
Old February 4th, 2009, 03:02 PM
Weekend Coder Weekend Coder is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Location: Tacoma, WA
Posts: 199 Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Weekend Coder User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 2 Days 10 h 34 m 53 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by prometheuzz
I was mild earlier. The above statement is false: '{' and '}' are not special characters. In some cases '{' is a special character but '}' is never one.
Well, I've played with it a bit and think I was on the wrong track. From what I can tell...

What I had was not 'any number of letters and numbers': it only hexadecimal digits (0-F). \s doesn't just match spaces: it matches any whitespace character, including tabs, vtabs, &c., and I think you've applied the * wrongly: modifiers go after the terms they modify.

So I'm going to try this one:
Code:
'/\{SomeString [0-9a-zA-Z ]*\}/'

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreRegex Programming > Problem with expression

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