Jump to content
Mumble forums

username regex help


leonardinux
 Share

Recommended Posts

Hi to all.

I've setted up a Mumble server on Raspberry for a local Amateur Radio community. Each Amateur Radio Operator have a worldwide unique callsign following these rules:

([A-Z]{1,2}|[0-9][A-Z])[0-9]{1,5}[A-Z]{1,9}

I need to put this rules as a regex for username field in mumble-server.ini but every try failed.


Can anyone help me?


Leonardinux

Link to comment
Share on other sites

  • Moderators

You probably need to escape some of the special characters, and the worst part is that some of them need to be escaped twice if you paste them into a .ini file. I didn't think any of the characters you use require that though.


First of all though, what do you mean by "failed"? Does it simply not enforce them? Or does it not allow any new username after that point?

Full disclosure: I used to run a commercial Mumble host, and my opinions do not reflect the opinions of the Mumble project.

Avatar is stolen from here

Link to comment
Share on other sites

The regex works fine in other perl software I've made for personal use.

In username field in the mumble-serve.ini file it doesn't seems to work.

Any attempt to connect to mumble server is refused: "username invalid"

So I think I had to use another syntax... but what syntax have I to use?


Leonardinux

Link to comment
Share on other sites

  • Moderators

Sorry about the delay - there's nothing wrong with your regex... the problem lies in the parser for Murmur.ini. If I paste your regex directly in to a script that sets it via Ice, it works as expected. However, setting it through the .ini doesn't work, as you said.


So I spent some time playing with it, and it turns out this works:

 

username="((?:[A-Z]{1,2}|[0-9][A-Z])[0-9]{1,5}[A-Z]{1,9})"

I don't think the outside set of parenthesis is necessary, and I'm not sure whether setting the first either/or group being made non-matching matters. If you like, you can try just wrapping your original regexp in quotes and seeing if it works as expected, but I didn't think of that before blowing away my test server. :(


When I use the line pasted above, and restart the server (note that kill -hup doesn't reload configuration in Murmur, it only closes and re-opens log files), I am unable to connect with "fwaggle" or "FWAGGLE" but I am able to connect with "FW4GGLE".


Hope that helps. I'll update some examples on the Wiki.

Full disclosure: I used to run a commercial Mumble host, and my opinions do not reflect the opinions of the Mumble project.

Avatar is stolen from here

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...