From cb32d867c7ee56025733c28e3920c6389a2a2ffd Mon Sep 17 00:00:00 2001 From: Camille TJHOA Date: Thu, 19 Feb 2015 18:45:30 +0100 Subject: [PATCH 1/3] Add match string filter (cf #68) --- README.md | 11 +++++++++++ src/_filter/string/match.js | 20 ++++++++++++++++++++ src/filters.js | 1 + test/spec/filter/string/match.js | 28 ++++++++++++++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100755 src/_filter/string/match.js create mode 100755 test/spec/filter/string/match.js diff --git a/README.md b/README.md index 0ea98ec..406903c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ - [stripTags](#striptags) - [stringular](#stringular) - [test](#test) + - [match](#match) - [trim](#trim) - [ltrim](#ltrim) - [rtrim](#rtrim) @@ -1086,8 +1087,18 @@ Test if a string match a pattern
**Usage:** ```string | test: pattern: flag[optional]``` ```html

{{ '15/12/2003' | test: '^[0-9]{2}[/]{1}[0-9]{2}[/]{1}[0-9]{4}$': 'i' }}

+

{{ '0123456' | test: '\\D': 'i' }}