Forum Academy Marketplace Showcase Pricing Features

Splitting Up Text By Word/Character Count?

I figure this shouldn’t be too complicated, but I’ve been searching all day and can’t figure out a solution, so here it goes…

I have a basic multi-line input, and the user can input a chunk of text. I want to send the text to external API’s but need to split it up in order to do so.

So basically I want to take say 2,000 words, and split it up into 4 groups of 500 words each that I can access from a repeating group or a custom state.

Is there a way to do this with Regex?

I really appreciate any tips or advice.