Skip to content

Latest commit

 

History

History
executable file
·
39 lines (26 loc) · 1.22 KB

README.md

File metadata and controls

executable file
·
39 lines (26 loc) · 1.22 KB

plastik-regex-validator

plastik-regex-validator validates user input against a specified regular expression.

Demos and documentation are available on the component page.

Pull requests are always welcome. If you encounter any bugs, please feel free to submit an issue.

Installation

bower install plastik-regex-validator --save

Basic usage

See component page for more details.

Regular expressions are executed against the entire input string. Therefore, it is important to use ^ and $ as necessary to ensure that the entire string conforms to the desired restrictions.

Example

<input is="iron-input" bind-value="{{value1}}" validator="alphanumeric-validator">

<plastik-regex-validator regex="/^[a-z0-9]$/i" validator-name="alphanumeric-validator">
</plastik-regex-validator>

<input is="iron-input" bind-value="{{value2}}" validator="zip-validator">

<plastik-regex-validator regex="/^\d{5,6}(?:[-\s]\d{4})?$/" validator-name="zip-validator">
</plastik-regex-validator>