I've been looking for what seems like hours, and I just cannot find a solution for this. My regex skills are terrible but I'm sure for someone with the knowledge this will be easy.
/^(?:[1-9]{1,3}GB)|(?:[0-9]{1,2}.[0-9]{1,2}TB)$/i
As you can see it's pretty simple. I just need to match one or the other but I don't know where I'm going wrong.
Examples:
<?= $validate->data('100GB'); ?>
This should match since it's 3 digits followed by "GB."
<?= $validate->data('2.65TB'); ?>
This should also match since it's 1 digit followed by period, followed by two more digits, followed by "TB."
EDIT: I needed to modify the numeric count but still doesn't perform as expected.
For anyone interested, here is the final regex.
/^(?:[0-9]{1,3}(?:GB|TB))|(?:[0-9]{1,2}\.[0-9]{1,2}(?:GB|TB))$/i