#!/bin/bash
grep -oE  '[0-9]{,2}_' <<< "12_ 21"
grep -oP  '[0-9]{,2}_' <<< "21_ 1{,2}_"