@mkazlauskas/plastik-regex-validator

3.0.0 • Public • Published

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>

Package Sidebar

Install

npm i @mkazlauskas/plastik-regex-validator

Weekly Downloads

1

Version

3.0.0

License

BSD-3-Clause

Unpacked Size

22.3 kB

Total Files

8

Last publish

Collaborators

  • mkazlauskas