Est. Budget: $10.00
I have strings of text where I want to find certain patterns and replace these patterns accordingly. I will add my own logic afterwards, so what I need now is just the basic find & replace implementation. If you are good with regular expressions this should be a piece of cake.
The pattern that I'm looking for is something like this: [keyword, parameter], there can be spaces in between like [ keyword , parameter].
For example see this text string:
$content = '<h1>this is content</h1> welcome [user,name] how are you? how is [user, bestFriend]. Did you go to [field, sómeInternationalFíéld] after you visited [ field , someCity ]? here is the weather report: [report, someReportName]';
What I need, in pseudo-code is for you to create a function that does the following:
1- find all patterns [ string that could contain numbers, spaces and the international characters á, é, í, ó, ú and ñ , string that could contain numbers, spaces and ...