JSFiddle - React, Tailwind, and code Playground

by jimkennelly

HTML

<form action="/">

<label for="railcar">Please enter a rail car</label><br>

<input type="text" id="railcar" name="railcar" onkeyup="this.value = this.value.toUpperCase();" pattern="^[A-Z][0-9]{1,6}$|^[A-Z][A-Z ][0-9]{1,6}$|^[A-Z][A-Z ][A-Z ][0-9]{1,6}$|^[A-Z][A-Z ][A-Z ][A-Z ][0-9]{1,6}$" placeholder="enter a rail car like CSX100 or UP34343 - no spaces please" style="width:50%"
title="Enter 1 to letters (no spaces) followed by 1 to 6 digits (no spaces)"

>

<br><br>

<input type="submit" >

</form>