Asserts that the column matches the provided regular expression

@param string $column
@param string $regexp
@param string $conjunction
@return \PSX\Sql\Condition
357905
public function regexp($column, $regexp, $conjunction = 'AND')
    {
        return $this->addExpression(new Condition\Regexp($column, $regexp, $conjunction));
    }
363677
public static <T> String join(Iterable<T> iterable, CharSequence conjunction) {
		if (null == iterable) {
			return null;
		}
		return join(iterable.iterator(), conjunction);
	}
351703
public function orNotEqual($column, $argument)
    {
        $this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' <> ' . $argument;

        return $this;
    }
1094275
private void processConjunctionExpression(List<TerminalNode> conjunctions) {
    Predicate conjunctionReuse;

    for (int i = conjunctions.size() - 1; i >= 0; i--) {
      Predicate rhs = currentPredicates.removeLast();
      Predicate lhs = currentPredicates.removeLast();

      switch (conjunctions.get(i).getText().toLowerCase()) {
        case "and":
          conjunctionReuse = new And(lhs, rhs);
          break;
        case "or":
          conjunctionReuse = new Or(lhs, rhs);
          break;
        default:
          conjunctionReuse = new Xor(lhs, rhs);
          break;
      }
      currentPredicates.add(conjunctionReuse);
    }
  }
71785
public function orMoreOrEqual($column, $argument)
    {
        $this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' >= ' . $argument;

        return $this;
    }
1105011
public function isNull($column, string $separator = 'AND', bool $not = false)
	{
		$this->wheres[] =
		[
			'type'      => 'null',
			'column'    => $column,
			'separator' => $separator,
			'not'       => $not,
		];

		return $this;
	}
378526
protected static function _check($check, $regex)
	{
		if (is_string($regex) && preg_match($regex, $check))
		{
			return true;
		}
		return false;
	}
142383
protected function addCondition($column, Closure $value = null, $separator = 'AND'): self
    {
        if (($column instanceof Closure) && $value === null) {
            $this->sql->addHavingGroupCondition($column, $separator);
        } else {
            $expr = $this->expression->init($column, $separator);
            if ($value) {
                $value($expr);
            }
        }
        return $this;
    }
1018422
static function matchRegexp( &$text, $reg, $num )
    {
        $reg = str_replace( '/', "\\/", $reg );
        if ( preg_match( "/$reg/", $text, $regs ) && $num < count( $regs ) )
        {
            $text = str_replace( $regs[$num], '', $text );
            return $regs[$num];
        }
        return null;
    }
362244
final protected function where_not_null($column, $or = false){
        $this->_wheres[] = [$this->and_or($or), sprintf("%s IS NOT NULL", $this->escape_column_name($column))];
        return $this;
    }
141368
public function like($column, $pattern)
    {
        $this->conditions = [$this->grammar->buildId($column) . ' LIKE ' . $pattern];

        return $this;
    }
279692
protected function regexColumnSearch($column, $keyword, $caseSensitive = true)
    {
        if ($this->isOracleSql()) {
            $sql = $caseSensitive ? 'REGEXP_LIKE( ' . $column . ' , ? )' : 'REGEXP_LIKE( LOWER(' . $column . ') , ?, \'i\' )';
            $this->query->whereRaw($sql, [$keyword]);
        } else {
            $sql = $caseSensitive ? $column . ' like ?' : 'LOWER(' . $column . ') like ?';
            $this->query->whereRaw($sql, [Str::lower($keyword)]);
        }
    }
1032760
public function condition(Expression $left, Expression $right, $comparator, $conjunction = Cmp::CONJUNCTION_AND)
    {
        $this->getWhereStatement()->add($left, $right, $comparator, $conjunction);
        
        return $this;
    }
907006
private function joinRe($regexps, $separator)
    {
        // backreferenceRe matches an open parenthesis or backreference. To avoid
        // an incorrect parse, it additionally matches the following:
        // - [...] elements, where the meaning of parentheses and escapes change
        // - other escape sequences, so we do not misparse escape sequences as
        //   interesting elements
        // - non-matching or lookahead parentheses, which do not capture. These
        //   follow the '(' with a '?'.
        $backreferenceRe = '#\[(?:[^\\\\\]]|\\\.)*\]|\(\??|\\\([1-9][0-9]*)|\\\.#';
        $numCaptures = 0;
        $ret = '';

        $strLen = count($regexps);
        for ($i = 0; $i < $strLen; ++$i) {
            $offset = $numCaptures;
            $re = $regexps[$i];

            if ($i > 0) {
                $ret .= $separator;
            }

            while (strlen($re) > 0) {
                $matches = array();
                $matchFound = preg_match($backreferenceRe, $re, $matches, PREG_OFFSET_CAPTURE);

                if ($matchFound === 0) {
                    $ret .= $re;
                    break;
                }

                // PHP aliases to match the JS naming conventions
                $match = $matches[0];
                $index = $match[1];

                $ret .= substr($re, 0, $index);
                $re = substr($re, $index + strlen($match[0]));

                if (substr($match[0], 0, 1) === '\\' && isset($matches[1])) {
                    // Adjust the backreference.
                    $ret .= "\\" . strval(intval($matches[1][0]) + $offset);
                } else {
                    $ret .= $match[0];
                    if ($match[0] == "(") {
                        ++$numCaptures;
                    }
                }
            }
        }

        return $ret;
    }
1034567
public function lowerThen($column, $value, $conjunction = 'AND')
    {
        return $this->addExpression(new Condition\Basic($column, '<=', $value, $conjunction));
    }
1281478
public Constraint regexp(String regexp, String type) {
        RegexpConstraint c = new RegexpConstraint(regexp);
        c.setType(type);
        return c;
    }
247729
public function sql_quoteCondition($cond, $db) {
		// https://www.debuggex.com/r/6AXwJ1Y3Aac8aocQ/3
		// https://regex101.com/r/yM5vK4/1
		// this took me lots of sleepless nights
		$out = preg_replace_callback('/'.
			'\w+\((?:(?>[^()]+)|\((?:(?>[^()]+)|^(?R))*\))*\)|'. // exclude SQL function names "foo("
			'(?:(\b(?<!:)'. // exclude bind parameter ":foo"
				'[a-zA-Z_](?:[\w\-_.]+\.?))'. // match only identifier, exclude values
			'(?=[\s<>=!)]|$))/i', // only when part of condition or within brackets
			function($match) use($db) {
				if (!isset($match[1]))
					return $match[0];
				if (preg_match('/\b(AND|OR|IN|LIKE|NOT)\b/i',$match[1]))
					return $match[1];
				return $db->quotekey($match[1]);
			}, $cond);
		return $out ?: $cond;
	}