Chapter 23: Problem 7
\((\text {Searching for Numbers)}\) Write a regular expression that will search a string and match a valid number. A number can have any number of digits, but it can have only digits and a decimal point. The decimal point is optional, but if it appears in the number, there must be only one, and it must have digits on its left and its right. There should be white space or a beginning- or end-ofline character on either side of a valid number. Negative numbers are preceded by a minus sign.
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.