regexp-is-intraline
v1.0.1
Published
A function that tells you whether a RegExp is confined to the line it's executed on or not.
Downloads
15
Readme
RegExp Is Intraline
A function that tells you whether a RegExp is confined to the line it's executed on or not.
Essentially if the RegExp cannot possibly match a newline character, either \r or \n, then it's "intraline".
All features up to ES2025 are supported.
Install
npm install regexp-is-intralineUsage
import isIntraline from 'regexp-is-intraline';
// Let's check if some regexes are intraline or not
isIntraline ( /hello/ ); // => true
isIntraline ( /hello\nworld/ ); // => falseLicense
MIT © Fabio Spampinato
