Search: Removing full stop if part of acronym / abbreviation with pattern_replace character filter

Hi!
My input are author names and book titles.
I try to delete full stops if they appear in acronyms and abbreviations.
For example:
S.O.S. should be replaced with SOS
H.P. Lovecraft should be replaced with HP Lovecraft
My current regex replaces everything, I have not yet found a way to only match the full stops.

My current analyzers and filters:

"analysis": {
      "filter": {
        "autocomplete_filter": {
          "type": "edge_ngram",
          "min_gram": 1,
          "max_gram": 20
        }
      },
      "char_filter": {
        "remove_fullstop": {
          "type": "pattern_replace",
          "pattern": """\w+(?:\.\w+)+""",
          "replacement": ""
        }
      },
      "analyzer": {
        "standard_ascii": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "asciifolding"
          ],
          "char_filter": [
            "remove_fullstop"
          ]
        },
        "autocomplete": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "asciifolding",
            "autocomplete_filter"
          ],
          "char_filter": [
            "remove_fullstop"
          ]
        }
      }
    }

Does anyone know a solution?
Thank you in advance!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.