# sslibs-regex-validation

> ## Installation

Latest version **0.0.5** (published 2019-11-22) · 0 weekly downloads

## Install

```sh
npm install sslibs-regex-validation
pnpm add sslibs-regex-validation
yarn add sslibs-regex-validation
bun add sslibs-regex-validation
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-11-22 |
| First published | 2019-06-17 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 110.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | stateless-studio |

## Links

- npm: https://www.npmjs.com/package/sslibs-regex-validation
- npm.io page: https://npm.io/package/sslibs-regex-validation

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 0.0.5 (latest) — 2019-11-22
- 0.0.4 — 2019-06-25
- 0.0.3 — 2019-06-25
- 0.0.2 — 2019-06-18
- 0.0.1 — 2019-06-17

## README

# RegexValidation

## Installation

`npm i sslibs-regex-validation`

## Example

```typescript
import { Component, OnInit } from '@angular/core';
import { FormBuilder, Validators } from '@angular/forms';
import {
	ValidationGroup,
	getValidationErrorString,
	confirmPasswordValidator,
	addRequired,
	FormValidator,
	validatorFocus
} from 'sslibs-regex-validation';

@Component({
	selector: 'app-password-reset-page',
	templateUrl: './password-reset-page.component.html',
	styleUrls: [ './password-reset-page.component.scss' ]
})
export class PasswordResetPageComponent extends FormValidator
	implements OnInit {
	public errorString?: string;

	constructor(
		private formBuilder: FormBuilder,
		private handler: HandlerService
	) {
		super();
	}

	ngOnInit() {
		this.createForm();
	}

	createForm() {
		this.form = this.formBuilder.group(
			{
				email: [ '', addRequired(ValidationGroup.email) ],
				password: [ '', ValidationGroup.password ],
				confirmPassword: [ '', [ Validators.required ] ]
			},
			{ validator: confirmPasswordValidator }
		);
	}

	onSubmit() {
		this.hasSubmit = true;

		if (this.form.invalid) {
			this.isValid = false;
			validatorFocus();

			return;
		}
		else {
			const data = this.form.getRawValue();

			// TODO: Send data to server
		}
	}
}

```

---
_Source: https://npm.io/package/sslibs-regex-validation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
