Hi all,
I've got a simple regular expression in JavaScript but I can't get it working. I'm simply trying to search a string for words that match a certain format, and then replace them with a bit of code.
For example, it'd search this string..
and replace it with
All I have for the regular expression so far is ":[a-zA-Z] ", and that doesn't seem to work. If anyone could give me some pointers it'd be appreciated..
I've got a simple regular expression in JavaScript but I can't get it working. I'm simply trying to search a string for words that match a certain format, and then replace them with a bit of code.
For example, it'd search this string..
Code:
The :fox jumped over the :gate into the field
Code:
The "+$('fox').val()+" jumped over the "+$('gate').val()+" into the field
All I have for the regular expression so far is ":[a-zA-Z] ", and that doesn't seem to work. If anyone could give me some pointers it'd be appreciated..