Skip to content

Latest commit

 

History

History
51 lines (32 loc) · 1.35 KB

.verb.md

File metadata and controls

51 lines (32 loc) · 1.35 KB

{%= name %} {%= badge("fury") %} {%= badge("travis") %}

{%= description %}

{%= include("install-npm", {save: true}) %}

Usage

var regex = require('{%= name %}');
regex.test('abc\uFFFExyz');
//=> 'true'

// strip non-characters
'abc\uFFFExyz'.replace(regex, '');

What's this all about?

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.

Run tests

Install dev dependencies:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %})

Author

{%= include("author") %}

License

{%= copyright() %} {%= license() %}


{%= include("footer") %}