diff --git a/src/betamax/cassette/interaction.py b/src/betamax/cassette/interaction.py
index f545bdb..799a8d5 100644
--- a/src/betamax/cassette/interaction.py
+++ b/src/betamax/cassette/interaction.py
@@ -69,6 +69,8 @@ class Interaction(object):
             self.replace(*placeholder.unpack(serializing))
 
     def replace_in_headers(self, text_to_replace, placeholder):
+        if text_to_replace == '':
+            return
         for obj in ('request', 'response'):
             headers = self.data[obj]['headers']
             for k, v in list(headers.items()):
@@ -79,6 +81,8 @@ class Interaction(object):
                     headers[k] = v.replace(text_to_replace, placeholder)
 
     def replace_in_body(self, text_to_replace, placeholder):
+        if text_to_replace == '':
+            return
         for obj in ('request', 'response'):
             body = self.data[obj]['body']
             old_style = hasattr(body, 'replace')
@@ -93,6 +97,8 @@ class Interaction(object):
                 self.data[obj]['body']['string'] = body
 
     def replace_in_uri(self, text_to_replace, placeholder):
+        if text_to_replace == '':
+            return
         for (obj, key) in (('request', 'uri'), ('response', 'url')):
             uri = self.data[obj][key]
             if text_to_replace in uri:

A blank string used for placeholder replacement can cause memory issue
**Version: betamax-0.8.0**

If you define a placeholder as described in the following, it can lead to memory issues, depending on how many blank strings you're trying to replace.

```python
username = ''
config.define_cassette_placeholder('<USERNAME>', username)
```

For example, if I have the original string `'WOW'` and perform the `.replace()` function, it will result in the following.
 ```python
>>> 'WOW'.replace('','<USERNAME>')
'<USERNAME>W<USERNAME>O<USERNAME>W<USERNAME>'
```

If you have multiple placeholders with a blank string, this compounds and can cause a memory issue. I experienced this issue in `src.betamax.cassette.interaction.py::Interaction::replace_in_uri`, but would think this is applicable to all functions that use `str.replace()` and it looks like it exists on the most current version of betamax too.

I can submit a PR to check for blank strings prior to calling `str.replace()`, but figure I'd bring it up in an issue first.
diff --git a/tests/unit/test_cassette.py b/tests/unit/test_cassette.py
index edd83d8..01ae406 100644
--- a/tests/unit/test_cassette.py
+++ b/tests/unit/test_cassette.py
@@ -443,6 +443,7 @@ class TestInteraction(unittest.TestCase):
         self.interaction.replace('secret_value', '<SECRET_VALUE>')
         self.interaction.replace('foo', '<FOO>')
         self.interaction.replace('http://example.com', '<EXAMPLE_URI>')
+        self.interaction.replace('', '<IF_FAIL_THIS_INSERTS_BEFORE_AND_AFTER_EACH_CHARACTER')
 
         header = (
             self.interaction.data['request']['headers']['Authorization'][0])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest mock flake8
apt-get update apt-get install -y gcc
3.7
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
Babel==2.14.0
-e git+https://github.com/betamaxpy/betamax.git@316eb978a7e8d1c318a5ab8eb7230763c18b6c3b#egg=betamax
betamax-matchers==0.4.0
betamax-serializers==0.2.1
bleach==6.0.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
docutils==0.19
exceptiongroup==1.2.2
flake8==5.0.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==2.0.0
Jinja2==3.1.6
MarkupSafe==2.1.5
mccabe==0.7.0
mock==5.2.0
packaging==24.0
pluggy==1.2.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.17.2
pytest==7.4.4
pytz==2025.2
readme==0.7.1
readme-renderer==37.3
requests==2.31.0
requests-toolbelt==1.0.0
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
webencodings==0.5.1
zipp==3.15.0

name: betamax
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - babel==2.14.0
      - betamax-matchers==0.4.0
      - betamax-serializers==0.2.1
      - bleach==6.0.0
      - charset-normalizer==3.4.1
      - docutils==0.19
      - exceptiongroup==1.2.2
      - flake8==5.0.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - jinja2==3.1.6
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - mock==5.2.0
      - packaging==24.0
      - pluggy==1.2.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pytest==7.4.4
      - pytz==2025.2
      - readme==0.7.1
      - readme-renderer==37.3
      - requests==2.31.0
      - requests-toolbelt==1.0.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - webencodings==0.5.1
      - zipp==3.15.0
prefix: /opt/conda/envs/betamax

tests/unit/test_cassette.py::TestInteraction::test_replace
tests/unit/test_cassette.py::TestSerialization::test_add_urllib3_response tests/unit/test_cassette.py::TestSerialization::test_deserialize_prepared_request tests/unit/test_cassette.py::TestSerialization::test_deserialize_response_new tests/unit/test_cassette.py::TestSerialization::test_deserialize_response_old tests/unit/test_cassette.py::TestSerialization::test_from_list_handles_non_lists tests/unit/test_cassette.py::TestSerialization::test_from_list_returns_an_element tests/unit/test_cassette.py::TestSerialization::test_serialize_prepared_request tests/unit/test_cassette.py::TestSerialization::test_serialize_response tests/unit/test_cassette.py::test_cassette_initialization tests/unit/test_cassette.py::TestCassette::test_earliest_recorded_date tests/unit/test_cassette.py::TestCassette::test_eject tests/unit/test_cassette.py::TestCassette::test_find_match tests/unit/test_cassette.py::TestCassette::test_find_match__missing_matcher tests/unit/test_cassette.py::TestCassette::test_find_match_new_episodes_with_existing_unused_interactions tests/unit/test_cassette.py::TestCassette::test_find_match_new_episodes_with_no_unused_interactions tests/unit/test_cassette.py::TestCassette::test_holds_interactions tests/unit/test_cassette.py::TestCassette::test_serialize_interaction tests/unit/test_cassette.py::TestInteraction::test_as_response tests/unit/test_cassette.py::TestInteraction::test_as_response_returns_new_instance tests/unit/test_cassette.py::TestInteraction::test_deserialized_response tests/unit/test_cassette.py::TestInteraction::test_match tests/unit/test_cassette.py::TestInteraction::test_replace_in_body tests/unit/test_cassette.py::TestInteraction::test_replace_in_headers tests/unit/test_cassette.py::TestInteraction::test_replace_in_uri tests/unit/test_cassette.py::TestMockHTTPResponse::test_is_Message tests/unit/test_cassette.py::TestMockHTTPResponse::test_isclosed
src/betamax/cassette/interaction.py
src/betamax/cassette/interaction.py