I need to match a group of words and then match another group within those found. How can I do it with regexp? What is the general way for doing this?
For example I need to find words longer than 8 letters and then split all those words by groups of 4 letters, so that I can insert a dash or any other symbol with javascript.
So if my text is:
A full Reference & Help is available in the Library, or watch the video Tutorial.
my regexp must match
['Refe', 'renc', 'avai', 'labl', 'Tuto', 'rial']
I know that I can select long words with something like /[a-z]{8,}/ig
and then I need to apply somethig like /[a-z]{3}/ig
. So how do I combine the two?
If I just do /([a-z]{8,})[a-z]{4}/ig
it doesn't give me the right match.