Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Salamander - APP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eirik Martin Danielsen
Salamander - APP
Merge requests
!71
Resolve "Fix location regex"
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Resolve "Fix location regex"
68-fix-location-regex
into
master
Overview
0
Commits
1
Pipelines
0
Changes
2
Merged
Resolve "Fix location regex"
Anders Langlie
requested to merge
68-fix-location-regex
into
master
Jun 14, 2021
Overview
0
Commits
1
Pipelines
0
Changes
2
Closes
#68 (closed)
Edited
Jun 14, 2021
by
Anders Langlie
0
0
Merge request reports
Viewing commit
f94badc0
Show latest version
2 files
+
6
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
f94badc0
location names can contain spaces
· f94badc0
Anders Langlie
authored
Jun 14, 2021
constants/inputRequirements.js
+
5
−
3
View file @ f94badc0
Edit in single-file editor
Open in Web IDE
Show full file
@@ -3,11 +3,13 @@ export const NUMBER_MAX_LENGTH = 15;
export
const
LOCATION_NUMBER_MAX_LENGTH
=
4
;
/******************************************* REGEXES ************************************************/
export
const
EMAIL_REGEX
=
"
^[ÆØÅæøåa-zA-Z0-9_.+-]+@[ÆØÅæøåa-zA-Z0-9-]+
\\
.[ÆØÅæøåa-zA-Z0-9-.]+$
"
;
// Valid email
export
const
PASSWORD_REGEX
=
"
^(?=.*[ÆØÅæøåA-Za-z])(?=.*
\\
d)[ÆØÅæøåA-Za-z
\\
d]{2,}$
"
;
// 9 characters, at least one letter and one number
export
const
EMAIL_REGEX
=
"
^[ÆØÅæøåa-zA-Z0-9_.+-]+@[ÆØÅæøåa-zA-Z0-9-]+
\\
.[ÆØÅæøåa-zA-Z0-9-.]+$
"
;
// Valid email
export
const
PASSWORD_REGEX
=
"
^(?=.*[ÆØÅæøåA-Za-z])(?=.*
\\
d)[ÆØÅæøåA-Za-z
\\
d]{2,}$
"
;
// 9 characters, at least one letter and one number
export
const
MEASUREMENT_REGEX
=
"
^(
\\
d+(?:[
\\
.
\\
,]
\\
d{1,2})?)$
"
;
// Accepts integers and decimal numbers with comma or period. 2 decimal precision!
export
const
INTEGER_REGEX
=
"
^[0-9]*[1-9][0-9]*$
"
;
//Accepts only integers
export
const
LEGAL_LOCATION_REGEX
=
"
^[ÆØÅæøå
\\
w
\\
-]+$
"
;
//Accepts trings containing legal file characters
export
const
LEGAL_LOCATION_REGEX
=
"
^[ÆØÅæøå
\\
w
\\
-]+$
"
;
//Accepts trings containing legal file characters
/**************************************** FEEDBACK MESSAGES *****************************************/
export
const
INVALID_EMAIL_MESSAGE
=
"
Invalid email!
"
;
Loading