#!/usr/local/bin/node var text = 'てすとですよ。0H' var rule = 'text.match(/ですよ/)&&text.match(/[0-9]+H/' var flg = eval(rule) if(flg){ console.log('matched') }else{ console.log('unmatched') }