Jump to content

match :this & :that in a string


racken

Recommended Posts

I'm trying to make some regex that will find all the cases of words which start with a :

I have (:[a-zA-Z]) which just finds the first letter atm I've no idea how to find the whole word

 

For an example string

 

SELECT * , u.nick FROM webid_useraccounts
LEFT JOIN webid_users u ON (u.id = webid_useraccounts.user_id)
WHERE user_id = :user_id ORDER BY date LIMIT :OFFSET , :perpage

 

it would return :user_id, :OFFSET and :perpage

 

 

 

EDIT: nvm I was just being thick I missed the *. It should of been (:[a-zA-Z]*)

Link to comment
https://forums.phpfreaks.com/topic/273190-match-this-that-in-a-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.