DEV Community

Discussion on: Code your own vue: rendering and states

Collapse
 
ghaerdi profile image
Gil Rudolf Härdi

I got the regex from a friend, he said that he got the regex from vue repository.
Now that you are asking I realized that I don't know the reason for make the regex in that way, the regex can be simplified to: {{(.+)?}}.

{{ Match two open brackets.
}} Match two close brackets.
The point . match anything and the + extend the point to match more than one character, the ? make optional the expression inside of the parenthesis.