Inserts the information about the dateStamp of a dump and the project
name into a pattern.

@param pattern
String with wildcards
@param dateStamp
@param project
@return String with injected information.
545364
public static String insertDumpInformation(String pattern,
			String dateStamp, String project) {
		if (pattern == null) {
			return null;
		} else {
			return pattern.replace("{DATE}", dateStamp).replace("{PROJECT}",
					project);
		}
	}
66811
public void setPattern(String pattern) {
        if (pattern == null || pattern.length() <= 0) {
            throw new IllegalArgumentException(
                    "Pattern to search for can not be null or of length 0");
        }
        pattern_.text_ = pattern;
        initialize();
    }
416247
public static String format(final Object object, final String pattern) {
		if (object instanceof Date) {
			return JKFormatUtil.formatDate((Date) object, pattern);
		}
		if (object instanceof Time) {
			return JKFormatUtil.formatTime((Time) object, pattern);
		}
		if (object instanceof Timestamp) {
			return JKFormatUtil.formatTimeStamp((Timestamp) object, pattern);
		}
		if (object instanceof java.util.Date) {
			return JKFormatUtil.formatDate((java.util.Date) object, pattern);
		}
		if (object instanceof Double) {
			return JKFormatUtil.formatDouble((Double) object, pattern);
		}
		if (object != null) {
			return object.toString();
		}
		return null;
	}
249817
private String[] getDateTimePatterns(ProjectProperties properties, String[] timePatterns)
   {
      List<String> patterns = new ArrayList<String>();
      char datesep = properties.getDateSeparator();
      DateOrder dateOrder = properties.getDateOrder();

      switch (properties.getDateFormat())
      {
         case DD_MM_YY_HH_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.addAll(generateDateTimePatterns("dd" + datesep + "MM" + datesep + "yy", timePatterns));
                  break;
               }

               case MDY:
               {
                  patterns.addAll(generateDateTimePatterns("MM" + datesep + "dd" + datesep + "yy", timePatterns));
                  break;
               }

               case YMD:
               {
                  patterns.addAll(generateDateTimePatterns("yy" + datesep + "MM" + datesep + "dd", timePatterns));
                  break;
               }
            }
            break;
         }

         case DD_MM_YY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd" + datesep + "MM" + datesep + "yy");
                  break;
               }

               case MDY:
               {
                  patterns.add("MM" + datesep + "dd" + datesep + "yy");
                  break;
               }

               case YMD:
               {
                  patterns.add("yy" + datesep + "MM" + datesep + "dd");
                  break;

               }
            }
            break;
         }

         case DD_MMMMM_YYYY_HH_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.addAll(generateDateTimePatterns("dd MMMMM yyyy", timePatterns));
                  break;
               }

               case MDY:
               {
                  patterns.addAll(generateDateTimePatterns("MMMMM dd yyyy", timePatterns));
                  break;
               }

               case YMD:
               {
                  patterns.addAll(generateDateTimePatterns("yyyy MMMMM dd", timePatterns));
                  break;
               }
            }
            break;
         }

         case DD_MMMMM_YYYY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd MMMMM yyyy");
                  break;
               }

               case MDY:
               {
                  patterns.add("MMMMM dd yyyy");
                  break;
               }

               case YMD:
               {
                  patterns.add("yyyy MMMMM dd");
                  break;
               }
            }
            break;
         }

         case DD_MMM_HH_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.addAll(generateDateTimePatterns("dd MMM", timePatterns));
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.addAll(generateDateTimePatterns("MMM dd", timePatterns));
                  break;
               }
            }
            break;
         }

         case DD_MMM_YY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd MMM ''yy");
                  break;
               }

               case MDY:
               {
                  patterns.add("MMM dd ''yy");
                  break;
               }

               case YMD:
               {
                  patterns.add("''yy MMM dd");
                  break;
               }
            }
            break;
         }

         case DD_MMMMM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd MMMMM");
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.add("MMMMM dd");
                  break;
               }
            }
            break;
         }

         case DD_MMM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd MMM");
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.add("MMM dd");
                  break;
               }
            }
            break;
         }

         case EEE_DD_MM_YY_HH_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.addAll(generateDateTimePatterns("EEE " + "dd" + datesep + "MM" + datesep + "yy", timePatterns));
                  break;
               }

               case MDY:
               {
                  patterns.addAll(generateDateTimePatterns("EEE " + "MM" + datesep + "dd" + datesep + "yy", timePatterns));
                  break;
               }

               case YMD:
               {
                  patterns.addAll(generateDateTimePatterns("EEE " + "yy" + datesep + "MM" + datesep + "dd", timePatterns));
                  break;
               }
            }
            break;
         }

         case EEE_DD_MM_YY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("EEE dd" + datesep + "MM" + datesep + "yy");
                  break;
               }

               case MDY:
               {
                  patterns.add("EEE MM" + datesep + "dd" + datesep + "yy");
                  break;
               }

               case YMD:
               {
                  patterns.add("EEE yy" + datesep + "MM" + datesep + "dd");
                  break;
               }
            }
            break;
         }

         case EEE_DD_MMM_YY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("EEE dd MMM ''yy");
                  break;
               }

               case MDY:
               {
                  patterns.add("EEE MMM dd ''yy");
                  break;
               }

               case YMD:
               {
                  patterns.add("EEE ''yy MMM dd");
                  break;
               }
            }
            break;
         }

         case EEE_HH_MM:
         {
            patterns.addAll(generateDateTimePatterns("EEE ", timePatterns));
            break;
         }

         case DD_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd" + datesep + "MM");
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.add("MM" + datesep + "dd");
                  break;
               }
            }
            break;
         }

         case DD:
         {
            patterns.add("dd");
            break;
         }

         case HH_MM:
         {
            patterns.addAll(Arrays.asList(timePatterns));
            break;
         }

         case EEE_DD_MMM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("EEE dd MMM");
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.add("EEE MMM dd");
                  break;
               }
            }
            break;
         }

         case EEE_DD_MM:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("EEE dd" + datesep + "MM");
                  break;
               }

               case YMD:
               case MDY:
               {
                  patterns.add("EEE MM" + datesep + "dd");
                  break;
               }
            }
            break;
         }

         case EEE_DD:
         {
            patterns.add("EEE dd");
            break;
         }

         case DD_WWW:
         {
            patterns.add("F" + datesep + "'W'ww");
            break;
         }

         case DD_WWW_YY_HH_MM:
         {
            patterns.addAll(generateDateTimePatterns("F" + datesep + "'W'ww" + datesep + "yy", timePatterns));
            break;
         }

         case DD_MM_YYYY:
         {
            switch (dateOrder)
            {
               case DMY:
               {
                  patterns.add("dd" + datesep + "MM" + datesep + "yyyy");
                  break;
               }

               case MDY:
               {
                  patterns.add("MM" + datesep + "dd" + datesep + "yyyy");
                  break;
               }

               case YMD:
               {
                  patterns.add("yyyy" + datesep + "MM" + datesep + "dd");
                  break;
               }
            }
            break;
         }
      }

      return patterns.toArray(new String[patterns.size()]);
   }
582106
private static void patternCompile() {
		try {
			ptnNumber = Pattern.compile(strNumberPattern);
			ptnShortDate = Pattern.compile(strShortDatePattern);
			ptnLongDate = Pattern.compile(strLongDatePattern);
			ptnPercentage = Pattern.compile(strPercentagePattern);
			ptnCurrency = Pattern.compile(strCurrencyPattern);
			ptnViCurrency = Pattern.compile(strViCurrencyPattern);
		} catch (PatternSyntaxException ex) {
			System.err.println(ex.getMessage());
			System.exit(1);
		}

	}
906718
public static String formatDateStr(String dateStr, String... patterns) {
        String pattern = TIMESTAMP_PATTERN;
        if (patterns != null && patterns.length > 0
                && StringUtils.isNotBlank(patterns[0])) {
            pattern = patterns[0];
        }
        return DateFormatUtils.format(parseDate(dateStr), pattern);
    }
1329315
def in_date(objet, pattern):
        
        if objet:
            pattern = re.sub(" ", '', pattern)
            objet_str = abstractRender.date(objet)
            return bool(re.search(pattern, objet_str))
        return False
573617
public void addSynchronizeExcludePattern(String pattern) {

        try {
            m_synchronizeExcludePatterns.add(Pattern.compile(pattern));
        } catch (PatternSyntaxException e) {
            LOG.error(Messages.get().getBundle().key(Messages.LOG_INVALID_SYNCHRONIZE_EXCLUDE_PATTERN_1, pattern), e);
        }
    }
657525
public static Dater of(Date date, String pattern) {
		return of(date).with(pattern);
	}
1089940
public String createPatternString(String pattern, int length) {
        if (pattern == null) {
            return null;
        }

        int totalLength = pattern.length() * length;
        StringBuffer sb = new StringBuffer(totalLength);
        for (int i = 0; i < length; i++) {
            sb.append(pattern);
        }
        return sb.toString();
    }
25762
public static boolean isValid(String date, String pattern) {
        Date d = parseDate(date, pattern);
        return d != null && format(d, pattern).equals(date);
    }
110988
public static String format(TemporalAccessor localDate, String pattern) {
        return DateTimeFormatter.ofPattern(pattern).format(localDate);
    }
18653
public void setDateFormatPattern(String dateFormatPattern) {
        try {
            simpleDateFormat = new SimpleDateFormat(dateFormatPattern);
        } catch (Exception e) {
            throw new IllegalArgumentException("Incorrect date pattern. " +
                    "Ensure to use formats provided in https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html", e);
        }
    }
1106695
public static String format(final long millis, final String pattern) {
        return format(new Date(millis), pattern, null, null);
    }
1172877
public static SimonPattern create(String pattern) {
		if (pattern == null) {
			return null;
		}

		return createForType(pattern, Simon.class);
	}
81646
private static String adopt2JavaPattern(String pattern)
   {
      pattern = normalizePath(pattern);

      // any character except '/', one or more times
      pattern = pattern.replaceAll("\\" + ANY_NAME, "[^/]+");

      // any character except '/' exactly one time
      pattern = pattern.replaceAll(ANY_CHAR, "[^/]{1}");

      return pattern;
   }
347506
protected static String insertPattern(final String logFileName, final String rollPattern) {   
    int index = logFileName.lastIndexOf('.');
    if(index==-1) return logFileName + rollPattern;
    return logFileName.substring(0, index) + rollPattern + logFileName.substring(index); 
  }