private List<String> replaceInUnescapedSegmentsInternal(Pattern pPattern, String pReplacement, int pReplaceLimit){
    
    List<String> lReplacedStringsList = new  ArrayList<String>();
    int lReplaceCount = 0;
    
    for(ScriptSegment lSegment : mSegmentList){
      if(lSegment instanceof UnescapedTextSegment) {
        
        //Match on the contents of this unescaped segment
        Matcher lMatcher = pPattern.matcher(lSegment.getContents());
        
        StringBuffer lNewContents = new StringBuffer();
        while (lMatcher.find() && (pReplaceLimit == -1 || lReplaceCount < pReplaceLimit)) {
          //Make a record of the string we replaced
          lReplacedStringsList.add(lMatcher.group());
          lMatcher.appendReplacement(lNewContents, pReplacement);
          lReplaceCount++;
        }
        lMatcher.appendTail(lNewContents);
        
        //Replace the contents of the segment with the processed string
        lSegment.setContents(lNewContents.toString());
        
      }
    }
    
    return lReplacedStringsList;    
  }