-1

Consider this string: "something/word/statement-fm-4512-co-km458" how to get those 4 digits (4512) using Regex? it is not always after 'fm-' or before '-co' but is always 4 digits

mp3846
  • 15
  • 5
  • 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 Jan 07 '20 at 08:55

1 Answers1

0

Try with the following regex:

([0-9]{4})

There are many regex tools online where you can learn and build your own regex. (see)

davidm
  • 1,132
  • 6
  • 17