I have need to configure a regex to match nth item (whitespace separated). I have below so far which gets 3rd item from a line, however it is a group item. Is it possible to modify the regex to actually match the 3rd item as the first match in result?
https://regex101.com/r/FKscLq/1
Also is there an equivalent regex to match the nth number (whitespace separated)?
E.g. below string should match 2323 as 2nd number. String should return no matches for 3rd number.
Fiji 123545 27.10.1981 Westpac 2323 Bank 232dcc desc
Edit: I have got the regex to match nth word now. See below, it works beautifully. https://regex101.com/r/2F4J9o/1
I still need to get the nth number match though.
^[0-9]?$. If the separators are just spaces and tabs, then you could usestring.Splitfor the first pass^[0-9]+$