001    /**
002     * Copyright (c) 2010, SIB. All rights reserved.
003     * 
004     * SIB (Swiss Institute of Bioinformatics) - http://www.isb-sib.ch Host -
005     * https://sourceforge.net/projects/javaprotlib/
006     * 
007     * Redistribution and use in source and binary forms, with or without
008     * modification, are permitted provided that the following conditions are met:
009     * Redistributions of source code must retain the above copyright notice, this
010     * list of conditions and the following disclaimer. Redistributions in binary
011     * form must reproduce the above copyright notice, this list of conditions and
012     * the following disclaimer in the documentation and/or other materials provided
013     * with the distribution. Neither the name of the SIB/GENEBIO nor the names of
014     * its contributors may be used to endorse or promote products derived from this
015     * software without specific prior written permission.
016     * 
017     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
018     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
019     * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
020     * ARE DISCLAIMED. IN NO EVENT SHALL SIB/GENEBIO BE LIABLE FOR ANY DIRECT,
021     * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022     * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023     * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
024     * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027     */
028    package org.expasy.jpl.commons.base.io;
029    
030    
031    /**
032     * A list of static regular expressions.
033     * 
034     * @author nikitin
035     * 
036     * @version 1.0
037     * 
038     */
039    public final class RegexConstants {
040            
041            /** algebraic sign */
042            private static final String SIGN = "[+-]";
043            
044            /** integer expression */
045            public static final String INTEGER = SIGN + "?\\d+";
046            
047            /** float expression */
048            public static final String REAL = SIGN + "?\\d+\\.?\\d*(?:[eE][-+]?\\d+)?";
049            
050            /**
051             * About new lines, sources at http://en.wikipedia.org/wiki/Newline:
052             * 
053             * Systems based on ASCII or a compatible character set use either LF (Line
054             * feed, '\n', 0x0A, 10 in decimal) or CR (Carriage return, '\r', 0x0D, 13
055             * in decimal) individually, or CR followed by LF (CR+LF, 0x0D 0x0A). These
056             * characters are based on printer commands: The line feed indicated that
057             * one line of paper should feed out of the printer, and a carriage return
058             * indicated that the printer carriage should return to the beginning of the
059             * current line.
060             * 
061             * <ul>
062             * <li>LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac
063             * OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others</li>
064             * <li>CR+LF: DEC RT-11 and most other early non-Unix, non-IBM OSes, CP/M,
065             * MP/M, MS-DOS, OS/2, Microsoft Windows, Symbian OS</li>
066             * <li>CR: Commodore 8-bit machines, TRS-80, Apple II family, Mac OS up to
067             * version 9 and OS-9</li>
068             * </ul>
069             */
070            public static final String LINE_DELIMITOR = "(?:\r\n|\n)";
071            
072    }