src/extensions/default/InlineTimingFunctionEditor/TimingFunctionUtils.js
function bezierCurveMatch(str, lax) {
        var match;

        // First look for any cubic-bezier().
        match = str.match(BEZIER_CURVE_VALID_REGEX);
        if (match && _validateCubicBezierParams(match)) { // cubic-bezier() with valid params
            return _tagMatch(match, BEZIER);
        }

        match = str.match(BEZIER_CURVE_GENERAL_REGEX);
        if (match) {
            match = _getValidBezierParams(match);
            if (match && _validateCubicBezierParams(match)) {
                return _tagMatch(match, BEZIER);
            } else { // this should not happen!
                window.console.log("brackets-cubic-bezier: TimingFunctionUtils._getValidBezierParams created invalid code");
            }
        }

        // Next look for the ease functions (which are special cases of cubic-bezier())
        if (lax) {
            // For lax parsing, just look for the keywords
            match = str.match(EASE_LAX_REGEX);
            if (match) {
                return _tagMatch(match, BEZIER);
            }
        } else {
            // For strict parsing, start with a syntax verifying search
            match = str.match(EASE_STRICT_REGEX);
            if (match) {
                // return exact match to keyword that we need for later replacement
                return _tagMatch(str.match(EASE_LAX_REGEX), BEZIER);
            }
        }

        // Final case is linear.
        if (lax) {
            // For lax parsing, just look for the keyword
            match = str.match(LINEAR_LAX_REGEX);
            if (match) {
                return _tagMatch(match, BEZIER);
            }
        } else {
            // The linear keyword can occur in other values, so for strict parsing we
            // only detect when it's on same line as "transition" or "animation"
            match = str.match(LINEAR_STRICT_REGEX);
            if (match) {
                // return exact match to keyword that we need for later replacement
                return _tagMatch(str.match(LINEAR_LAX_REGEX), BEZIER);
            }
        }

        return null;
    }
function bezierCurveMatch(str, lax) {
        var match;

        // First look for any cubic-bezier().
        match = str.match(BEZIER_CURVE_VALID_REGEX);
        if (match && _validateCubicBezierParams(match)) { // cubic-bezier() with valid params
            return _tagMatch(match, BEZIER);
        }

        match = str.match(BEZIER_CURVE_GENERAL_REGEX);
        if (match) {
            match = _getValidBezierParams(match);
            if (match && _validateCubicBezierParams(match)) {
                return _tagMatch(match, BEZIER);
            } else { // this should not happen!
                window.console.log("brackets-cubic-bezier: TimingFunctionUtils._getValidBezierParams created invalid code");
            }
        }

        // Next look for the ease functions (which are special cases of cubic-bezier())
        if (lax) {
            // For lax parsing, just look for the keywords
            match = str.match(EASE_LAX_REGEX);
            if (match) {
                return _tagMatch(match, BEZIER);
            }
        } else {
            // For strict parsing, start with a syntax verifying search
            match = str.match(EASE_STRICT_REGEX);
            if (match) {
                // return exact match to keyword that we need for later replacement
                return _tagMatch(str.match(EASE_LAX_REGEX), BEZIER);
            }
        }

        // Final case is linear.
        if (lax) {
            // For lax parsing, just look for the keyword
            match = str.match(LINEAR_LAX_REGEX);
            if (match) {
                return _tagMatch(match, BEZIER);
            }
        } else {
            // The linear keyword can occur in other values, so for strict parsing we
            // only detect when it's on same line as "transition" or "animation"
            match = str.match(LINEAR_STRICT_REGEX);
            if (match) {
                // return exact match to keyword that we need for later replacement
                return _tagMatch(str.match(LINEAR_LAX_REGEX), BEZIER);
            }
        }

        return null;
    }
function bezierCurveMatch ( str , lax ) { var match ; // First look for any cubic-bezier(). match = str . match ( BEZIER_CURVE_VALID_REGEX ) ; if ( match && _validateCubicBezierParams ( match ) ) { // cubic-bezier() with valid params return _tagMatch ( match , BEZIER ) ; } match = str . match ( BEZIER_CURVE_GENERAL_REGEX ) ; if ( match ) { match = _getValidBezierParams ( match ) ; if ( match && _validateCubicBezierParams ( match ) ) { return _tagMatch ( match , BEZIER ) ; } else { // this should not happen! window . console . log ( "brackets-cubic-bezier: TimingFunctionUtils._getValidBezierParams created invalid code" ) ; } } // Next look for the ease functions (which are special cases of cubic-bezier()) if ( lax ) { // For lax parsing, just look for the keywords match = str . match ( EASE_LAX_REGEX ) ; if ( match ) { return _tagMatch ( match , BEZIER ) ; } } else { // For strict parsing, start with a syntax verifying search match = str . match ( EASE_STRICT_REGEX ) ; if ( match ) { // return exact match to keyword that we need for later replacement return _tagMatch ( str . match ( EASE_LAX_REGEX ) , BEZIER ) ; } } // Final case is linear. if ( lax ) { // For lax parsing, just look for the keyword match = str . match ( LINEAR_LAX_REGEX ) ; if ( match ) { return _tagMatch ( match , BEZIER ) ; } } else { // The linear keyword can occur in other values, so for strict parsing we // only detect when it's on same line as "transition" or "animation" match = str . match ( LINEAR_STRICT_REGEX ) ; if ( match ) { // return exact match to keyword that we need for later replacement return _tagMatch ( str . match ( LINEAR_LAX_REGEX ) , BEZIER ) ; } } return null ; }
Match a bezier curve function value from a CSS Declaration or Value.

Matches returned from this function must be handled in
BezierCurveEditor._getCubicBezierCoords().

@param {string} str  Input string.
@param {!boolean} lax  Parsing mode where:
lax=false Input is a Full or partial line containing CSS Declaration.
This is the more strict search used for initial detection.
lax=true  Input is a previously parsed value. This is the less strict search
used to convert previously parsed values to RegExp match format.
@return {!RegExpMatch}
Match a bezier curve function value from a CSS Declaration or Value .