Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Regex Barf

Quote Reply
Regex Barf
You can cause the script to barf by entering certain characters into the invalid username character field....

A fatal error has occurred:

Invalid [] range "/-+" before HERE mark in regex m/[\x00-\x1f?*`¬|\\~#'@:;><.,/-+ << HERE =^!]/

Please enable debugging in setup for more details.

I want to block these characters so it looks like they should be escaped properly first.
Quote Reply
Re: [Paul] Regex Barf In reply to
What did you enter in the box? Did you read the part:

In Reply To:


If you wish to disallow usernames with -'s in them, you must put the - at the end.


Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Regex Barf In reply to
It wasn't on that page that the actual error occured...the page wanting the invalid characters worked fine it was when creating a new user that the error occured....but no I didn't read that but I knew what the problem was...I just thought escaping automatically would be better?
Quote Reply
Re: [Paul] Regex Barf In reply to
Hi Paul,
I had the same error when I was wanting to stop users from having a question mark in their usernames and it seemed to accept the new characters but then as you say once I did a test on a new user creation I got an error.
When I came back to the admin the initial two characters in the field appeared and the few I had added weren't even their then I submitted the page without changing anything and everything started working again.
John
Significant Media
Quote Reply
Re: [Paul] Regex Barf In reply to
The thing is that you should be able to specify a range. For example, if I don't want any extended characters in usernames, I could specify: \x80-\xFF. 0-9 could be useful to disallow digits.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Regex Barf In reply to
That can still be possible. Escaping metacharacters or only - if necessary shouldn't affect ranges should it?