php - How do I stop this from being greedy -


i have following regex:

#^/workorder/(.*)/# 

provided following uri's:

/workorder/archive/2/ 

the $matches variable preg_match() returning archive/2/

why doesn't last / in regex stop (.*) being greedy? add make regex stop when / delimiter found?

this it.

^/workorder/([^/]*)/ 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -