@Test public void convertPerlRegexToPattern_swiftfoxRegex() { final String perlStyleRegex = "/mozilla.*rv:[0-9\\.]+.*gecko\\/[0-9]+.*firefox\\/([0-9a-z\\+\\-\\.]+).*swiftfox/si"; RegularExpressionConverter.convertPerlRegexToPattern(perlStyleRegex); final Pattern pattern = RegularExpressionConverter.convertPerlRegexToPattern(perlStyleRegex, true); final Pattern expected = Pattern.compile("mozilla.*rv:[0-9\\.]+.*gecko\\/[0-9]+.*firefox\\/([0-9a-z\\+\\-\\.]+).*swiftfox", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); assertThat(pattern.flags()).isEqualTo(expected.flags()); }
public static Pattern convertPerlRegexToPattern(@Nonnull final String regex) { return convertPerlRegexToPattern(regex, false); }
RegularExpressionConverter { public static Pattern convertPerlRegexToPattern(@Nonnull final String regex) { return convertPerlRegexToPattern(regex, false); } }
RegularExpressionConverter { public static Pattern convertPerlRegexToPattern(@Nonnull final String regex) { return convertPerlRegexToPattern(regex, false); } private  RegularExpressionConverter(); }
RegularExpressionConverter { public static Pattern convertPerlRegexToPattern(@Nonnull final String regex) { return convertPerlRegexToPattern(regex, false); } private  RegularExpressionConverter(); static String convertPatternToPerlRegex(@Nonnull final Pattern pattern); static Pattern convertPerlRegexToPattern(@Nonnull final String regex); static Pattern convertPerlRegexToPattern(@Nonnull final String regex, @Nonnull final boolean faultTolerant); }
RegularExpressionConverter { public static Pattern convertPerlRegexToPattern(@Nonnull final String regex) { return convertPerlRegexToPattern(regex, false); } private  RegularExpressionConverter(); static String convertPatternToPerlRegex(@Nonnull final Pattern pattern); static Pattern convertPerlRegexToPattern(@Nonnull final String regex); static Pattern convertPerlRegexToPattern(@Nonnull final String regex, @Nonnull final boolean faultTolerant);  }