How can i match this with ruby regex {{article | image}}
It also needs to work for {{ article |image}} or any ot开发者_JAVA技巧her withespace combination inside the double braces.
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.
This will match all your {{ }}
content:
{{([^}]*)}}
精彩评论