0

I am trying to get the digits before and after a specific word using regular expression.

Suppose the string i want to test is

"Started walking 8 hours 9"

I want to get both the numbers 8 and 9 between hours. Please don't mind the grammar of the sentence it is just for an example.

Help is much appreciated. Thanks.

Amal
  • 190
  • 1
  • 8
  • Looks like you are looking to create a regex, but do not know where to get started. Please check [Reference - What does this regex mean](https://stackoverflow.com/questions/22937618) resource, it has plenty of hints. Also, refer to [Learning Regular Expressions](https://stackoverflow.com/a/2759417/3832970) post for some basic regex info. Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem. – Wiktor Stribiżew Sep 03 '19 at 13:44
  • @WiktorStribiżew I will surely check it out but can you please reopen the thread if needed. – Amal Sep 03 '19 at 13:48
  • *Once you get some expression ready and still have issues with the solution, please edit the question with the latest details and we'll be glad to help you fix the problem.* – Wiktor Stribiżew Sep 03 '19 at 13:51

0 Answers0