-3

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

mohitd
  • 1
  • `(?[0-9]+)\s*(?[A-Za-z]+)` in case of "*number* followed by *text*", `(?[0-9]+)\s*steps?` in case of "*number* followed by *steps*" – Dmitry Bychenko Oct 15 '19 at 07:29

1 Answers1

-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