It also needs to work for {{ article |image}} or any other withespace combination inside the double braces.
{} are not metacharacters except when used as the {min,max} quantifier, so no need to escape them, especially not in the character class.
Paul Creasey
2010-01-16 15:46:39
nice tip, Paul, ty
Rubens Farias
2010-01-16 15:50:15
+1
A:
Need a lot more information about exactly what you need and the type of data you are searching.
{{.*}}
This will work for both examples.
{{\s*\w+\s*\|\s*\w+\s*}}
Is much more specific.
Paul Creasey
2010-01-16 15:42:57
`{{.*}}` will match this entire string: `{{abc}} nono {{def}}`; you should to use a non-greedy pattern, as `{{.*?}}`
Rubens Farias
2010-01-16 15:55:10
thanks, this works. what should I replace in this regex to make in work for only {{article | image}} and not for {{article | something_else}}.
2010-01-16 15:56:37
`{{\s*article\s*\|\s*image\s*}}` will do the trick; sad use for a regex
Rubens Farias
2010-01-16 16:06:30