Skip to content

Instantly share code, notes, and snippets.

Embed
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([
/Android|webOS/,
/|iPhone|iPad|iPod/,
/|BB10|BlackBerry/,
/|IEMobile|Opera Mini/,
/|Mobile|mobile/
].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
You can’t perform that action at this time.