Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-28-2011, 01:05 AM   PM User | #1
johnmerlino
Regular Coder

 
Join Date: Oct 2009
Posts: 189
Thanks: 38
Thanked 3 Times in 3 Posts
johnmerlino is an unknown quantity at this point
trying to match a regular expression

Hey all,

I think I get these two wrong:

'blogs/([a-zA-Z0-9\-_\/])'
'blogs/categories/([a-zA-Z0-9\-_\/])'

I want the first to match something like blogs/johnmerlino but not blogs/ or not blogs/johnmerlino/abcdef

I want the second to match something like blogs/categories/johnmerlino but not blogs/categories/ or blogs/ or blogs/categories/johnmerlino/abcdef


I think I got it.

This seems to work:

'blogs/([a-z_]+)'

Last edited by johnmerlino; 03-28-2011 at 01:24 AM..
johnmerlino is offline   Reply With Quote
Reply

Bookmarks

Tags
regex, regular expressions

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:48 AM.


Advertisement
Log in to turn off these ads.