What’s a good regex to match a decimal number to check that it does not contain exponential values?
Thanks for any help.
Can I just say something like match anything except if it contains “e-“, “e+”, “E-” or “E+”?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Without detailed specs it’s not an easy task using regular expressions. In my opinion, regex is inappropriate when you know so little about the format of your input.
Update after OP’s edit:
That would be e.g.
^(?!.*[eE][+-]).*$(using a negative lookahead), but probably matching more than you like…