Is this possible in reg-ex?
subject='fox';
adjective='quick brown';
verb='jumps';
text='The <<adjective>> <<subject>> <<verb>> over the lazy dog.'
reg-ex would return:
'The quick brown fox jumps over the lazy dog.'
Is this possible in reg-ex?
subject='fox';
adjective='quick brown';
verb='jumps';
text='The <<adjective>> <<subject>> <<verb>> over the lazy dog.'
reg-ex would return:
'The quick brown fox jumps over the lazy dog.'
You don't even need regular expressions to do that. I assume PHP has a string.Replace function of some sort, right? So wouldn't you just be doing (in C#, sorry):
text = "The <<adjective>> <<subject>> <<verb>> over the lazy dog.";
text = text.Replace("<<adjective>>", adjective);
text = text.Replace("<<subject>>", subject);
text = text.Replace("<<verb>>", verb);