#85 Regular expression computed

How do you create a computed property that matches a regular expression? Here is how I used to do it:

isValidEmail: Ember.computed('model.email',function(){
return this.get('model.email').match(/^.+@.+\..+$/);

But I found a more readable way to do it using the match computed property:

isValidEmail: Ember.computed.match('email', /^.+@.+\..+$/)

Originally published at Ember Daily Tips.