I have a 14 digits long number that I need to split into this format:
xxx xxx xxx xxxxx I have a regex that splits every 3 characters starting from the end (because of the lookahead?)
(?=(\d{3})+(?!\d)) Which gives me:
xx xxx xxx xxx xxx I tried using lookbehind in regex101.com but I get a pattern error...
(?<=(\d{3})+(?!\d)) How can I use lookbehind so that it starts from the begining of the string (if that's my issue) and how can I repeat the pattern only 3 times and then switch to a \d{5} ?
(^\+|\d{3} |\d{5}$)