![]() |
Anybody know regex?
What's a regular expression that will find all occurences of anything between the following characters: {$ and }
So if I have some text: "The site name is {$site}", I need to match 'site'. It has to be greedy as there may be multiple matches. Any ideas? Thanks. |
try using this:
/\{\$[^\}]+\}/ BTW: "greedy regexp" does not have anything to do with multiple matches... if you would use /\{\$.*\}/ on "hello {$site} and a happy new {$what}" greedy regexp would match a "{$site} and a happy new {$what}" and the non-greedy one would match a "{$site}" and "{$what}" |
Quote:
|
no problem, anytime :)
|
All times are GMT -7. The time now is 11:40 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123