
Product
Introducing Immutable Scans
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.
noncharacter-regex
Advanced tools
Regular expression for matching or stripping non-characters from a string.
Regular expression for matching or stripping non-characters from a string.
npm i noncharacter-regex --save
var regex = require('noncharacter-regex');
regex.test('abc\uFFFExyz');
//=> 'true'
// strip non-characters
'abc\uFFFExyz'.replace(regex, '');
non-characters are useful, for example, when you're doing string transformations and you need to use temporary placeholders to avoid unintentional mutations. In those cases, this regex would be used before do your transformations to ensure that any existing non-characters are removed before you do your replacements.
Does that happen!?
It's unlikely, but from time to time the U+FFFE non-character may show up in strings since it has the reverse binary sequence of byte-order marks.
Visit noncharacters for more info.
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on February 24, 2015.
FAQs
Regular expression for matching or stripping non-characters from a string.
We found that noncharacter-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.