projects/wms-framework/src/lib/baseframework/Regex/RegexHelper.ts
Class representing the Regex object.
Methods |
Static isMatch | ||||||||||||||||||||
isMatch(target: string, expression: string, option: RegexOptions)
|
||||||||||||||||||||
Match the current expression on the target.
Parameters :
Returns :
boolean
A new instance of match. |
Static match | ||||||||||||||||||||
match(target: string, expression: string, option: RegexOptions)
|
||||||||||||||||||||
Creates a new instance of match.
Parameters :
Returns :
Match
A new instance of match. |
import { Match } from './Match';
import { RegexOptions } from './RegexOptions';
/**
* Class representing the Regex object.
*/
export class RegexHelper {
/**
* Creates a new instance of match.
* @param target The target to be evaluated.
* @param expression The regular expression.
* @param option The option.
* @returns A new instance of match.
*/
public static match(
target: string,
expression: string,
option: RegexOptions = RegexOptions.None
): Match {
return new Match(expression, target, option);
}
/**
* Match the current expression on the target.
* @param target The target to be evaluated.
* @param expression The regular expression.
* @param option The option.
* @returns A new instance of match.
*/
public static isMatch(
target: string,
expression: string,
option: RegexOptions = RegexOptions.None
): boolean {
return new Match(expression, target, option).success();
}
}