npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

using regex in node-input-validation

Hi, so i’m trying to use regex with the node-input-validation package

what i want to do is this ^0[0-9]{10}|^\+44[0-9]{10}

the first problem i’m having is with ‘|’ as it’s being recognised as a pipe

my second problem is with ‘+’

this is how i have it in my code
‘recipients.*’: ‘regex: ^0[0-9]{10}|^\+44[0-9]{10}


(Moved to #community:javascript)

Hi! Can you show the whole code statement rather than just a fragment? Indent it by four spaces to avoid it getting formatted:

indent preformatted text by 4 spaces