На основании этого комментария:
кажется, что он идеально работает с такими шаблонами, как 1000%, 100, но теперь проблемы с десятичными значениями, такими как 101.50 или 199.50%
^[-+]?\d*\.?\d+\b%?$
Объяснение:
"
^ # Assert position at the beginning of the string
[-+] # Match a single character present in the list “-+”
? # Between zero and one times, as many times as possible, giving back as needed (greedy)
[0-9] # Match a single character in the range between “0” and “9”
* # Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
\. # Match the character “.” literally
? # Between zero and one times, as many times as possible, giving back as needed (greedy)
[0-9] # Match a single character in the range between “0” and “9”
+ # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
\b # Assert position at a word boundary
% # Match the character “%” literally
? # Between zero and one times, as many times as possible, giving back as needed (greedy)
\$ # Assert position at the end of the string (or before the line break at the end of the string, if any)
"
В качестве примечания: Вы действительно должны были учесть дополнительную часть из ответа @Tim.Взгляните на учебник, предложенный другими ответами.