🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

human-regex

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

human-regex - npm Package Compare versions

Comparing version
2.1.1
to
2.1.2
+9
-1
package.json
{
"name": "human-regex",
"version": "2.1.1",
"version": "2.1.2",
"description": "Human-friendly regex builder with English-like syntax",

@@ -50,3 +50,11 @@ "main": "dist/human-regex.cjs.js",

"tslib": "^2.8.1"
},
"repository": {
"type": "git",
"url": "https://github.com/rajibola/human-regex.git"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/rajibola"
}
}
-74
/**
* Regex flags (optimized as Set-based)
*/
declare const Flags: {
readonly GLOBAL: "g";
readonly NON_SENSITIVE: "i";
readonly MULTILINE: "m";
readonly DOT_ALL: "s";
readonly UNICODE: "u";
readonly STICKY: "y";
};
/**
* Precomputed character ranges
*/
declare const Ranges: Readonly<{
digit: "0-9";
lowercaseLetter: "a-z";
uppercaseLetter: "A-Z";
letter: "a-zA-Z";
alphanumeric: "a-zA-Z0-9";
anyCharacter: ".";
}>;
type RangeKeys = keyof typeof Ranges;
/**
* Quantifier symbols
*/
declare const Quantifiers: Readonly<{
zeroOrMore: "*";
oneOrMore: "+";
optional: "?";
}>;
declare class HumanRegex {
private parts;
private flags;
constructor();
digit(): this;
special(): this;
word(): this;
whitespace(): this;
literal(text: string): this;
or(): this;
range(name: RangeKeys): this;
letter(): this;
exactly(n: number): this;
atLeast(n: number): this;
atMost(n: number): this;
between(min: number, max: number): this;
oneOrMore(): this;
optional(): this;
zeroOrMore(): this;
startGroup(): this;
endGroup(): this;
startAnchor(): this;
endAnchor(): this;
global(): this;
nonSensitive(): this;
protocol(): this;
www(): this;
tld(): this;
path(): this;
private add;
toString(): string;
toRegExp(): RegExp;
}
/**
* Memoized predefined patterns
*/
declare const createRegex: () => HumanRegex;
declare const Patterns: {
email: () => RegExp;
url: () => RegExp;
phoneInternational: () => RegExp;
};
export { createRegex, Patterns, Flags, Ranges, Quantifiers };