Home > Software engineering >  RegEx Help. Using lookaround to insert periods inbetween spaced digits, but only if the digit isn�
RegEx Help. Using lookaround to insert periods inbetween spaced digits, but only if the digit isn�

Time:01-25

Examples:

RP Distort2 1 0 0b.exe
AFakeFilename4 5 0 2 SEP2 5 63 8
A4 5 8 7 6 COM99 6 4 4 1

Should become:

RP Distort2 1.0.0b.exe
AFakeFilename4 5.0.2 SEP2 5.63.8
A4 5.8.7.6 COM99 6.4.4.1

My current expression is:

(?<=\d) (?=\d)

Replacement: .

Right now my expression only partially works. It inserts periods between all spaced digits. I.E: RP Distort2 1 0 0b.exe becomes RP Distort2.1.0.0b.exe when it should be RP Distort2 1.0.0b.exe

I am not a RegEx wizard so this has me kind of stumped. I also got my expression from another site - I know it's using lookaround but I don't exactly understand the syntax of lookaround.

I'm using this expression in enter image description here

  • Related