Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
example of how to write a multiline RegExp and keep under row max length lint rules
const DEVICES_REGEXP = new RegExp([
/|IEMobile|Opera Mini/,
].map(function(r) {return r.source}).join(''), 'i');
// output: /Android|webOS|iPhone|iPad|iPod|BB10|BlackBerry|IEMobile|Opera Mini|Mobile|mobile/i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment