I have this regex here:
"\d+.?\d*\^\d+\.?\d*"
What it should be doing is finding something like 2^10 in a string like 1*1+2^10*1 but it comes back with 1+2^10.
What am I doing wrong? I assume it is something to do with the .?
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.
In regular expressions, the
.character stands for “match any character”. You will have to escape it:You can try out your regular expression using RegexPal