import re


def replace_by_ordinary_dictionary(
  dictionary, string, placeholder_storage=None
):
  """
  Apply a dictionary of ordinary replacements to a string.
  """
  
  for pattern in dictionary:
    
    replacement = dictionary[pattern]
    if placeholder_storage is not None:
      replacement = \
        placeholder_storage.create_placeholder_store_markup(replacement)
    
    string = re.sub(
      re.escape(pattern),
      replacement,
      string
    )
  
  return string