Fix IRC nickname regex

This commit is contained in:
Yarmo Mackenbach 2021-06-03 09:58:39 +02:00
parent f5ea4c05bf
commit 3d99d2373d
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -15,7 +15,7 @@ limitations under the License.
*/ */
const E = require('../enums') const E = require('../enums')
const reURI = /^irc\:\/\/(.*)\/([a-zA-Z0-9]*)/ const reURI = /^irc\:\/\/(.*)\/([a-zA-Z0-9\-\[\]\\\`\_\^\{\|\}]*)/
const processURI = (uri) => { const processURI = (uri) => {
const match = uri.match(reURI) const match = uri.match(reURI)
@ -63,6 +63,10 @@ const tests = [
uri: 'irc://chat.ircserver.org/alice?param=123', uri: 'irc://chat.ircserver.org/alice?param=123',
shouldMatch: true, shouldMatch: true,
}, },
{
uri: 'irc://chat.ircserver.org/alice_bob',
shouldMatch: true,
},
{ {
uri: 'https://chat.ircserver.org/alice', uri: 'https://chat.ircserver.org/alice',
shouldMatch: false, shouldMatch: false,