benchmarks/scenarios/ember.js
function match(dependentKey, regexp) {
    return _emberMetalComputed.computed(dependentKey, function () {
      var value = _emberMetalProperty_get.get(this, dependentKey);

      return typeof value === 'string' ? regexp.test(value) : false;
    });
  }
function match(dependentKey, regexp) {
    return _emberMetalComputed.computed(dependentKey, function () {
      var value = _emberMetalProperty_get.get(this, dependentKey);

      return typeof value === 'string' ? regexp.test(value) : false;
    });
  }
function match ( dependentKey , regexp ) { return _emberMetalComputed . computed ( dependentKey , function ( ) { var value = _emberMetalProperty_get . get ( this , dependentKey ) ; return typeof value === 'string' ? regexp . test ( value ) : false ; } ) ; }
A computed property which matches the original value for the
dependent property against a given RegExp, returning `true`
if the value matches the RegExp and `false` if it does not.

Example

```javascript
var User = Ember.Object.extend({
hasValidEmail: Ember.computed.match('email', /^.+@.+\..+$/)
});

var user = User.create({loggedIn: false});

user.get('hasValidEmail'); // false
user.set('email', '');
user.get('hasValidEmail'); // false
user.set('email', 'ember_hamster@example.com');
user.get('hasValidEmail'); // true
```

@method match
@for Ember.computed
@param {String} dependentKey
@param {RegExp} regexp
@return {Ember.ComputedProperty} computed property which match
the original value for property against a given RegExp
@public
A computed property which matches the original value for the dependent property against a given RegExp returning true if the value matches the RegExp and false if it does not .