Search code examples
google-sheetsgoogle-sheets-formula

Google Sheets formula to remove all punctuation excluding period (.)


Would appreciate some help with a Google Sheets formula to remove all punctuation excluding period (.)

I'm currently using the formula:

=REGEXREPLACE(D2,"[[:punct:]]", " ")

However this removes all punctuation and I need the periods to remain.

Input Expected Output
cpe:2.3:a:caldera:openlinux_server:3.1:::::::* cpe 2.3 a caldera openlinux server 3.1
cpe:2.3:o:trustix:secure_linux:1.01:::::::* cpe 2.3 o trustix secure linux 1.01

Solution

  • it should be:

    =TRIM(REGEXREPLACE(A2, "[:,_\*]", " "))
    

    enter image description here