0

FROM: START 123 456 789 START abc def ghi START xyz

I want to get three results:

  • START 123 456 789
  • START abc def ghi
  • START xyz
Inez
  • 2,115
  • 3
  • 20
  • 25

1 Answers1

2

You can try:

(START[a-z\s\d]+)

which matches START followed by any lowercase letter, digit or space.

demo

However, I'm not sure why you are not using a simple split().

ergonaut
  • 6,929
  • 1
  • 17
  • 47
  • Thank you for your answer, maybe I should be more specific - I actually want to catch all the content between two STARTs but also the content after the last START. – Inez Oct 17 '15 at 05:06
  • It does. Click the demo. – ergonaut Oct 17 '15 at 05:09
  • https://regex101.com/r/qL4gA0/2 <- I would like to get that into first group as well. – Inez Oct 17 '15 at 05:17
  • @Inez, that's a completely different string, and not what was in your question. This is a classic [XY problem](http://mywiki.wooledge.org/XyProblem), you asked for (and got) help for something that was absolutely not what you needed. A more useful solution to your problem (which is NOT the same as a good answer to your question) is that you shouldn't try to parse HTML using a regex. Regex is not the language for SGML. Use something with DOM support instead. PHP, Python, Perl, etc. [You just can't parse HTML with regex.](http://stackoverflow.com/a/1732454/1072112) – ghoti Oct 17 '15 at 05:41
  • @Inez, I recommend you give ergonaut the green checkmark for accurately answering your question, then move on to a better question that includes source code of your actual attempt to solve whatever problem you're trying to solve. – ghoti Oct 17 '15 at 05:42