tmajor99
asked on
Regular Expression to replace spaces after certain letters
I need help with a regex to check for a letter and space following. I need to replace all the spaces between letters "G, L, P, M, H, S".
Data: Results
-------------- ------------
1.2 G P M 1.2 GPM
99 L P M 99 LPM
1.5 L P S 1.4 LPS
88 G P S 88 GPS
Data: Results
-------------- ------------
1.2 G P M 1.2 GPM
99 L P M 99 LPM
1.5 L P S 1.4 LPS
88 G P S 88 GPS
Try replacing:
(?<=[GLPMHS])\h(?=[GLPMHS])
with an empty string.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
(?:[\A-Z]\+ *)|\h