custom expression for negative and...

User 1982097 Photo


Registered User
72 posts

if this is the expression for numbers, is there a way to allow negative and positive numbers?
/^[0-9]+$/
Coffee roasting is my passion - seriously
User 187934 Photo


Senior Advisor
20,190 posts

Hi telimon,
Give this a try.
/^-?\d+(\.\d+)?$/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 1982097 Photo


Registered User
72 posts

It worked! thanks
Coffee roasting is my passion - seriously

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.