I have a large text file and looking to find some data
Start1234 …data…End
I need to match on Start that has 4 chars in front of it (1234 is just an example) and four spaces in front of that then read to End. This would be fine using IndexOf returning data but I need to return the 1234 with the result, but it is part of the match so won’t be included. Any ideas on how I can to do this?
That's wrong. If you use
text.IndexOf("1234")you will get the index before1234, so it's included: