code: private void replaceProperties(Set<CmsResource> matchedResources) {
  
          for (CmsResource resource : matchedResources) {
              try {
                  CmsProperty prop = getCms().readPropertyObject(resource, m_settings.getProperty().getName(), false);
                  Matcher matcher = Pattern.compile(m_settings.getSearchpattern()).matcher(prop.getValue());
                  if (m_settings.getReplacepattern().isEmpty()) {
                      prop.setValue("", "");
                  } else {
                      prop.setValue(matcher.replaceAll(m_settings.getReplacepattern()), CmsProperty.TYPE_INDIVIDUAL);
                  }
                  getCms().lockResource(resource);
                  getCms().writePropertyObjects(resource, Collections.singletonList(prop));
                  getCms().unlockResource(resource);
              } catch (CmsException e) {
                  LOG.error("Ubable to change property", e);
              }
          }
      }
docs: Replace properties of given resources.<p>
  
  @param matchedResources to replace properties