Skip to content

Commit

Permalink
Fix URL checking regex
Browse files Browse the repository at this point in the history
  • Loading branch information
xenosf committed Mar 23, 2024
1 parent 293275f commit ad7eaf4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { InstructorRequestFormData } from './InstructorRequestFormData';

const URL_REGEX = '(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)';
const URL_REGEX = /(https?:\/\/)?(www\.)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)|(https?:\/\/)?(www\.)?(?!ww)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/;

Check failure on line 5 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.ts

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Unnecessary escape character: \+

Check failure on line 5 in src/web/app/pages-static/request-page/instructor-request-form/instructor-request-form.component.ts

View workflow job for this annotation

GitHub Actions / lint (windows-latest)

Unnecessary escape character: \+

@Component({
selector: 'tm-instructor-request-form',
Expand Down

0 comments on commit ad7eaf4

Please sign in to comment.