All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bbn.parliament.sparql_query_builder.RegExFlag Maven / Gradle / Ivy

// Copyright (c) 2019, 2020 RTX BBN Technologies Corp.

package com.bbn.parliament.sparql_query_builder;

/**
 * An enumeration of flags that modify the behavior of a regular expressions as
 * created in the {@code ExprFactory} class.
 *
 * @author iemmons
 */
public enum RegExFlag {
	/**
	 * By default, the meta-character '.' matches any character except a newline
	 * (#x0A) or carriage return (#x0D). If this flag is present, '.' matches any
	 * character.
	 */
	DOT_ALL("s"),

	/**
	 * By default, the meta-character ^ matches the start of the entire string,
	 * while $ matches the end of the entire string. If this flag is present, ^
	 * matches the start of any line, while $ matches the end of any line.
	 */
	MULTI_LINE("m"),

	/**
	 * By default, matches are case-sensitive. If this flag is present, matches
	 * are case-insensitive.
	 */
	CASE_INSENSITIVE("i"),

	/**
	 * If present, whitespace characters (#x9, #xA, #xD and #x20) in the regular
	 * expression are removed prior to matching, except whitespace characters
	 * within character class expressions. This flag can be used, to break up
	 * long regular expressions into readable lines.
	 */
	IGNORE_WHITESPACE("x"),

	/**
	 * If present, all characters in the regular expression are treated as
	 * representing themselves, not as meta-characters. Furthermore, when this
	 * flag is present, the characters $ and \ have no special significance when
	 * used in the replacement string.
	 */
	LITERAL_MATCH("q");

	private String xPathFlag;

	private RegExFlag(String flag) {
		xPathFlag = flag;
	}

	String getXPathFlag() {
		return xPathFlag;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy