All Projects → inspect-js → is-regex

inspect-js / is-regex

Licence: MIT license
Is this value a JS regex?

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to is-regex

Regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Stars: ✭ 201 (+813.64%)
Mutual labels:  regex, regexp
moar
Deterministic Regular Expressions with Backreferences
Stars: ✭ 19 (-13.64%)
Mutual labels:  regex, regexp
Regex Automata
A low level regular expression library that uses deterministic finite automata.
Stars: ✭ 203 (+822.73%)
Mutual labels:  regex, regexp
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+21931.82%)
Mutual labels:  regex, regexp
cregex
A small implementation of regular expression matching engine in C
Stars: ✭ 72 (+227.27%)
Mutual labels:  regex, regexp
Regex Benchmark
It's just a simple regex benchmark of different programming languages.
Stars: ✭ 171 (+677.27%)
Mutual labels:  regex, regexp
Regex For Regular Folk
🔍💪 Regular Expressions for Regular Folk — A visual, example-based introduction to RegEx [BETA]
Stars: ✭ 242 (+1000%)
Mutual labels:  regex, regexp
Learn Regex Zh
🇨🇳 翻译: 学习正则表达式的简单方法
Stars: ✭ 1,772 (+7954.55%)
Mutual labels:  regex, regexp
url-regex-safe
Regular expression matching for URL's. Maintained, safe, and browser-friendly version of url-regex. Resolves CVE-2020-7661 for Node.js servers.
Stars: ✭ 59 (+168.18%)
Mutual labels:  regex, regexp
regexp-example
正则表达式实例搜集,通过实例来学习正则表达式。
Stars: ✭ 162 (+636.36%)
Mutual labels:  regex, regexp
Regex
An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
Stars: ✭ 2,125 (+9559.09%)
Mutual labels:  regex, regexp
IronRure
.NET Bindings to the Rust Regex Crate
Stars: ✭ 16 (-27.27%)
Mutual labels:  regex, regexp
Xioc
Extract indicators of compromise from text, including "escaped" ones.
Stars: ✭ 148 (+572.73%)
Mutual labels:  regex, regexp
Common Regex
🎃 常用正则表达式 - 收集一些在平时项目开发中经常用到的正则表达式。
Stars: ✭ 2,488 (+11209.09%)
Mutual labels:  regex, regexp
Regex Dos
👮 👊 RegEx Denial of Service (ReDos) Scanner
Stars: ✭ 143 (+550%)
Mutual labels:  regex, regexp
Stringi
THE String Processing Package for R (with ICU)
Stars: ✭ 204 (+827.27%)
Mutual labels:  regex, regexp
Orchestra
One language to be RegExp's Successor. Visually readable and rich, technically safe and extended, naturally scalable, advanced, and optimized
Stars: ✭ 103 (+368.18%)
Mutual labels:  regex, regexp
Proposal Regexp Unicode Property Escapes
Proposal to add Unicode property escapes `\p{…}` and `\P{…}` to regular expressions in ECMAScript.
Stars: ✭ 112 (+409.09%)
Mutual labels:  regex, regexp
Regaxor
A regular expression fuzzer.
Stars: ✭ 35 (+59.09%)
Mutual labels:  regex, regexp
regexp-expand
Show the ELisp regular expression at point in rx form.
Stars: ✭ 18 (-18.18%)
Mutual labels:  regex, regexp

is-regex Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS regex? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

var isRegex = require('is-regex');
var assert = require('assert');

assert.notOk(isRegex(undefined));
assert.notOk(isRegex(null));
assert.notOk(isRegex(false));
assert.notOk(isRegex(true));
assert.notOk(isRegex(42));
assert.notOk(isRegex('foo'));
assert.notOk(isRegex(function () {}));
assert.notOk(isRegex([]));
assert.notOk(isRegex({}));

assert.ok(isRegex(/a/g));
assert.ok(isRegex(new RegExp('a', 'g')));

Tests

Simply clone the repo, npm install, and run npm test

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].