Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

blood group regex

const validBloodGroupRegex = /^(A|B|AB|O)[+-]$/i; // Here i is to ignore case sensitivity
const validBloodGroupString = 'AB+';
const invalidBloodGroupString = 'BC+';

// Returns true
console.log(validBloodGroupRegex.test(validBloodGroupString))

// Returns false
console.log(validBloodGroupRegex.test(invalidBloodGroupString))
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript replace vowel 
Javascript :: how to check if enter is pressed javascript 
Javascript :: drupal twig node alias 
Javascript :: get select option count using jquery 
Javascript :: javascript random number between 
Javascript :: jacksepticeye 
Javascript :: how to add comment in react js 
Javascript :: readonly javascript 
Javascript :: validate name in javascript 
Javascript :: reactjs onclick open new page 
Javascript :: js validate date object 
Javascript :: Datatable Change page size for pdf 
Javascript :: js push to start of array 
Javascript :: package.json: License should be a valid SPDX license expression 
Javascript :: js hide element by class 
Javascript :: convert to small case in javascript 
Javascript :: html get selected option javascript 
Javascript :: Generate random whole numbers javascript 
Javascript :: why is the radiators in cars painted black 
Javascript :: usenavigate 
Javascript :: js select class 
Javascript :: delete all childs in node 
Javascript :: default ordering false in datatable 
Javascript :: window onload javascript 
Javascript :: fs file already exists 
Javascript :: change placeholder text jquery 
Javascript :: active menu adminlte 3 using jquery 
Javascript :: javascript trim each element in array 
Javascript :: convert binary to decimal javascript 
Javascript :: How to remove text from a string in javscript 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =