JSFiddle - React, Tailwind, and code Playground

by Matthew Day

JavaScript

// regex to check that a string follows the format: CCcC or CCcccC

var verifySomeString = function(someString) {
	if (someString.match(/^[A-Z]{2}([a-z]{1}|[a-z]{3})[A-Z]$/)) {
  	console.log('Yes');
  } else {
  	console.log('No');
  }
}

verifySomeString('ADqqaD');