Simple PHP Article Spinning Syntax Project

CLOSED
Bids
5
Avg Bid (USD)
$36
Project Budget (USD)
$30 - $250

Project Description:
I need a PHP script/function where i can pass in a search string, a replacement string and a article with nested spinning syntax. The function will then make replacements in the article in a single location where the search string is found in every possible variation of a top level spinning block. If there are multiple replacement in a variation sentence, then replace the first occurrence only. If there are no replacements possible in the entire article, return a blank string.

E.g. 1
Replace "Search string" with "Replacement string"
{Search string {Search string i am to replace|Search string and again Search string|Search string to replace}|Search string}

Since "Search string" is in every possible outcome, we can make the replacement. The output string would be
{Replacement string {Replacement string i am to replace|Replacement string and again Search string|Replacement string to replace}|Replacement string}

E.g. 2
Replace "Search string" with "Replacement string"
{Search string {No string here|Search string and again Search string|Search string to replace}|Search string}

Since the "Search string" is not on every replacement path, no replacement can be made.

I wrote this function in vb.net and it took me around 3 hours, however my code is a bit slow. So instead of just porting it to PHP, i figured i would post the project here to see if someone else could do it better. I would like the script/function to be as fast as possible. And keep in mind that spinning blocks can be nested many levels.

My max budget is $40.

Skills required:
PHP, Software Architecture
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 30
in 2 days
$ 30
in 0 days
Hire scriptzguru
$ 40
in 5 days
$ 30
in 0 days
Hire abhishek296
$ 50
in 2 days