001/**
002 * Copyright (c) 2001, Sergey A. Samokhodkin
003 * All rights reserved.
004 * <p>
005 * Redistribution and use in source and binary forms, with or without modification,
006 * are permitted provided that the following conditions are met:
007 * <p>
008 * - Redistributions of source code must retain the above copyright notice,
009 * this list of conditions and the following disclaimer.
010 * - Redistributions in binary form
011 * must reproduce the above copyright notice, this list of conditions and the following
012 * disclaimer in the documentation and/or other materials provided with the distribution.
013 * - Neither the name of jregex nor the names of its contributors may be used
014 * to endorse or promote products derived from this software without specific prior
015 * written permission.
016 * <p>
017 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
018 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
020 * IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
021 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
022 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
023 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
024 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
025 * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
026 *
027 * @version 1.2_01
028 */
029
030package regexodus;
031
032public interface REFlags {
033    /**
034     * All the following options turned off, EXCEPT UNICODE. Unicode handling can be turned off with "-u" at the end
035     * of a flag string, or by simply specifying only the flags you want in a bitmask, like
036     * {@code (REFlags.IGNORE_CASE | REFlags.MULTILINE | REFlags.DOTALL)}.
037     * <br>
038     * This behavior changed between the 0.1.1 and 0.1.2 release.
039     */
040    int DEFAULT = 16;
041
042    /**
043     * Pattern "a" matches both "a" and "A".
044     * Corresponds to "i" in Perl notation.
045     */
046    int IGNORE_CASE = 1 << 0;
047
048    /**
049     * Affects the behaviour of "^" and "$" tags. When switched off:
050     * <ul>
051     * <li> the "^" matches the beginning of the whole text;</li>
052     * <li> the "$" matches the end of the whole text, or just before the '\n' or "\r\n" at the end of text.</li>
053     * </ul>
054     * When switched on:
055     * <ul>
056     * <li> the "^" additionally matches the line beginnings (that is just after the '\n');</li>
057     * <li> the "$" additionally matches the line ends (that is just before "\r\n" or '\n');</li>
058     * </ul>
059     * Corresponds to "m" in Perl notation.
060     */
061    int MULTILINE = 1 << 1;
062
063    /**
064     * Affects the behaviour of dot(".") tag. When switched off:
065     * <ul>
066     * <li> the dot matches any character but EOLs('\r','\n');</li>
067     * </ul>
068     * When switched on:
069     * <ul>
070     * <li> the dot matches any character, including EOLs.</li>
071     * </ul>
072     * This flag is sometimes referenced in regex tutorials as SINGLELINE, which confusingly seems opposite to MULTILINE, but in fact is orthogonal.
073     * Corresponds to "s" in Perl notation.
074     */
075    int DOTALL = 1 << 2;
076
077    /**
078     * Affects how the space characters are interpreted in the expression. When switched off:
079     * <ul>
080     * <li> the spaces are interpreted literally;</li>
081     * </ul>
082     * When switched on:
083     * <ul>
084     * <li> the spaces are ignored, allowing an expression to be slightly more readable.</li>
085     * </ul>
086     * Corresponds to "x" in Perl notation.
087     */
088    int IGNORE_SPACES = 1 << 3;
089
090    /**
091     * Affects whether the predefined classes("\d","\s","\w",etc) in the expression are interpreted as belonging to Unicode. When switched off:
092     * <ul>
093     * <li> the predefined classes are interpreted as ASCII;</li>
094     * </ul>
095     * When switched on:
096     * <ul>
097     * <li> the predefined classes are interpreted as Unicode categories;</li>
098     * </ul>
099     */
100    int UNICODE = 1 << 4;
101
102    /**
103     * Turns on the compatibility with XML Schema regular expressions.
104     */
105    int XML_SCHEMA = 1 << 5;
106
107
108}