Reputation: 57
I need to know how can I match all after a X amount of characters. For example I want to match all after the first 5 characters in this phrase:
-I am a phrase and everything is matched after 10 characters.
I already tried with this expression but the count is unpredictable. Sometimes it only matches 1463 characters out of 2152 when it should match the exact same (Match all after 1500 characters, counting spaces).
const expression = /(?<=^.{1500}).*/s;
Upvotes: 0
Views: 109
Reputation: 59
This regEx can match every character after 5 first characters (including space).
(?<=[\w ]{5})\w+
Click here to see the result with your input.
https://regex101.com/r/SEXpmR/1
Upvotes: 1