0

What regexp could I use to check where a string contains a number x number

For example:

TIM MIDLAND BLACK 21X8.5 5-128 ET16 

How do I find out where is the 21X8?

My purpose is to get the whole string until that

Toto
  • 83,193
  • 59
  • 77
  • 109
Roland
  • 487
  • 1
  • 7
  • 11
  • Can you provide multiple inputs and expected/desired outputs? What have you tried so far and where have you gotten stuck? – David Allewell Nov 28 '19 at 13:50
  • 1
    What have you tried? What didn't work? What did you get? What did you expect? What doesn't work with your code and where is it? – Toto Nov 28 '19 at 13:50
  • Input: TIM MIDLAND BLACK 21X8.5 5-128 ET16 Output: TIM MIDLAND BLACK I have used this site: https://regexr.com/ but didn't find a solution – Roland Nov 28 '19 at 13:51
  • I just need the regex expression to find numberXnumber – Roland Nov 28 '19 at 13:52
  • @MaxExplode Well it's possible to be `TIM MIDLAND 5 BLACK 21X8.5 5-128 ET16 ` But I want to keep the `TIM MIDLAND 5 BLACK` – Roland Nov 28 '19 at 13:52
  • 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 Nov 28 '19 at 14:10

0 Answers0