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

com.neotys.neoload.model.writers.RegExpUtils Maven / Gradle / Ivy

There is a newer version: 3.3.3
Show newest version
package com.neotys.neoload.model.writers;

/**
 * This class utility methods are copied from com.neotys.nl.util.RegExpUtils.
 * Should be refactored to use the same code at some point.
 */
public class RegExpUtils {

    // the states used for parsing
    public static final int CONTINUE = 1;
    public static final int ON_DOLLAR = 2;
    public static final int EDIT_VAR = 3;

    private static char[] reservedCars = new char[] { '.', '\\', '+', '*', '?', '(', ')', '{' , '}' ,'[', ']', '$', '^', '|' };

    private RegExpUtils() {}

    private static boolean isReservedCar(char c) {
        for (int i=0; i \.txt
     * @param sentence
     * @return
     */
    public static String escape(String sentence) {
        StringBuilder result = new StringBuilder(sentence.length()+2);
        for(int i=0;i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy