Anyone good with regex here?

Hey guys, trying to wrap my head around something regex related.

What I want is to match any three digit number beginning with 8 or 9, so like 813 or 999, and then split that and insert it in a replacement.

For example, match 813 and insert the 8 and the 13 into a number – say, 112283313.

I think what I need is to break the first group into two sub expressions, but this is where it falls apart for me; so far I have (^[8-9]$)(^(d{2})$), but I understand that will not necessarily map to only three digits, I think it would be any number 8-9 or any two digit?

I think for the replacement piece it would be something like 1122$133$2

Does that seem right?

submitted by /u/skypeforbiz
[link] [comments]

Leave a Reply