I want to filter value from string which should result me a number followed by text. For example string looks like "There are 9 steps in the house which can be used to visit first floor". Output :"9 steps". Here number can change to any value. but that will be followed by steps
Asked
Active
Viewed 38 times
1 Answers
-1
you are looking for a number followed by a space and the word "steps". So
\d+ steps
is what you are looking for. \d+
assumes that the number also may consist of several digits, like "11 steps" or "218 steps". If only one digit is allowed, then remove the "+" symbol.

gofal3
- 1,213
- 10
- 16