Displaying 1 to 16 from 16 results

ansi-regex - Regular expression for matching ANSI escape codes

  •    Javascript

Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.

email-regex - Regular expression for matching email addresses

  •    Javascript

Use it for finding email addresses or checking if something is email like.You shouldn't use this for validating emails. Only for hinting to the user.

execall - Find multiple RegExp matches in a string

  •    Javascript

Instead of having to iterate over RegExp#exec, immutable, and with a nicer result format.Returns an array of objects with a match, sub-matches, and index.




comment-regex - Regular expression for matching JavaScript comments

  •    Javascript

This is pretty fragile and created for perf reasons where using a real parser would be overkill.The contents of the comment is in the first submatch.


has-values - Returns true if any values exist, false if empty

  •    Javascript

Returns true if any values exist, false if empty. Works for booleans, functions, numbers, strings, nulls, objects and arrays. Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.

frep - A find and replace utility

  •    Javascript

Find and replace utility for node.js. Transform strings by running multiple RegExp or string find-and-replace patterns on a string in sequence, reducing the final string to the accumulated result of each transformation. Patterns can be strings (or arrays of strings) or regular expressions. Replacements can be strings or functions.

nth-indexof - Find the nth position of a pattern in a string

  •    Javascript

Find the nth position of a pattern in a string. Similar to str.indexOf(pattern) except that you can choose how many occurrences of pattern you wish to skip before getting the index.

my-name-is-url - Intelligent URL parser

  •    Javascript

Intelligently recognises many different url formats in a string. For the browser and node. Here, have a play. my-name-is-url was created because I couldn't find a parser with a high enough success rate. The url spec is so vague that many strings could be a url, therefore matching the spec directly results in a lot of false positives. Most parsers get around this by requiring a url to contain a scheme to be matched as a url.