I want to validate string only if contains numerics and/or ‘h’ or ‘H’ character anywhere in the string.
e.g.
123 – valid
123h – valid
1h23 – valid
h234 – valid
123H – valid
asdf – invalid
123d – invalid
I am able to restrict string for numerics only but not with additional requirement of h. how can I do this?
Together with the ignore case option.
See it here on Regexr
^anchor to the start of the string.\d*match 0 or more digitsh?match 0 or 1 h\d*match 0 or more digits$anchor to the end of the string.