code: public static Pattern convertPerlRegexToPattern(@Nonnull final String regex, @Nonnull final boolean faultTolerant) {
  		Check.notNull(regex, "regex");
  
  		String pattern = regex.trim();
  		final Matcher matcher = faultTolerant ? PERL_STYLE_TOLERANT.matcher(pattern) : PERL_STYLE.matcher(pattern);
  		if (!matcher.matches()) {
  			throw new IllegalArgumentException("The given regular expression '" + pattern
  					+ "' seems to be not in PERL style or has unsupported modifiers.");
  		}
  
  		pattern = pattern.substring(1);
  		final int lastIndex = pattern.lastIndexOf('/');
  		pattern = pattern.substring(0, lastIndex);
  
  		final int flags = Flag.convertToBitmask(Flag.parse(matcher.group(1)));
  		return Pattern.compile(pattern, flags);
  	}
docs: Converts a PERL style regular expression into Java style.<br>
  <br>
  The leading and ending slash and the modifiers will be removed.
  
  @param regex
  A PERL style regular expression
  @param faultTolerant
  Fault-tolerant translating the flags
  @return Pattern