Skip to content
Advertisement

Preg_match identifier

I want ot get a match from my identifier.

I have a string like this coming in {/describe:foo} where I am trying to match {/describe:} to return foo, but am not getting the regex right, would someone mind pointing out what I did wrong? here’s my match.

JavaScript

Background I hope this can help others, a good reason to do this is to create replaceable control words in a string that can be interpreted and replaced, here’s an example of a RESTful poster that will run a descriptor on a control word.

JavaScript

Advertisement

Answer

You are missing the forward slash in your regexp:

JavaScript

or:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement