Please note that special characters are not allowed
Please note that special characters are not allowed
javascript validation, special characters are not allowed except ‘-‘ and ‘_’ [closed]
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
First, im not a pro in javascript so please bear with me.
I need to create a validation where user is not allowed to enter any special character except ‘-‘ and ‘_’ (exampe : ‘.’, ‘/’ and ‘@’ is not allowed).
I have tried to google and i know i can achieve this easily using javascript’s REGEX. However, im not allowed to use REGEX, so i need to code it without using REGEX.
I dont want to manually validate each special character, so please help me out.
Thanks for your time.
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
So in this assignment, you’re:
Not allowed to use regular expressions, and
Not allowed to «manually» (whatever that means) validate each «special character» (whatever that means)
I assume restriction #2 means you can’t compare each character to a specific list, for instance, in a switch statement.
With that starting point, assuming you’ve been given some sort of definition of what a «special» character is, you should be able to write the code.
Certain special characters are not allowed in the URL entered into the address bar of Internet Explorer
Important: The Internet Explorer 11 desktop application is retired and out of support as of June 15, 2022 for certain versions of Windows 10.
You can still access older, legacy sites that require Internet Explorer with Internet Explorer mode in Microsoft Edge. Learn how.
The Internet Explorer 11 desktop application will progressively redirect to the faster, more secure Microsoft Edge browser, and will ultimately be disabled via Windows Update. Disable IE today.
Source: Microsoft Support
RAPID PUBLISHING
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Symptom
When you use the address bar of Internet Explorer 6.0 or later to enter a username and password to access an FTP site, and the format of the URL you enter is ftp://username:password@domain, the following error message is displayed:
Windows cannot find ‘ ftp://username:password@domain’. Check the spelling and try again.
Cause
Either the username or the password contains any one of the characters:
This behavior is by design.
Resolution
If the username or password needs to contain any one of the characters listed in the Cause section, you will need to encode the special characters in the following way:
More Information
Consider the following example.
A user with the username «jdoe» and a password of «Sure?» who wants to access an FTP site on a server called «ftpserver».
When the user tries to access the site using Internet Explorer and enters ftp://jdoe:Sure?@ftpserver into the address bar, the access will fail and the error message described above will be displayed.
However, when the user enters ftp://jdoe:Sure%3F@ftpserver in the address bar, he or she will successfully access the FTP server.
DISCLAIMER
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
How do I not allow special characters, but allow space in regex?
I need to populate an error message when the user is entering special characters within a datagridview. as of now I have the following:
this regex works, and does not allow special character, however it is falls in the if statement if there is a space between characters, which should be allowed.
How do I make it to allow a space, but not special characters?
5 Answers 5
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
I think you just want to add a space to your regular expression:
When writing regular expressions it is generally a good habit to use the verbatim string operator @ as many of the special expressions require you to use a backslash character.
If you were explicitly telling the regular expression to ignore whitespace in the pattern you would then need to escape the space character.
If you wanted them to be able to use any whitespace characters (spaces, tabs, newlines, etc.), you could use the whitespace character class \s
Update
It appears that you may have wanted to a regular expression that excluded characters in a group.
But if you wanted to write an excluded group of characters in your regular expression you can put a ^ in your group. When the ^ is inside of a group [^] any characters that come after it are excluded from the match.
The regular expression [A-Z] would match any character A-Z. The regular expression [^A-Z] would match any character NOT A-Z.
If that is what you were looking for you could change your statement to:
This statement will match any string that contains any character not in the group. So if they type «Hello World» it would not match. If they typed «Hello! World» it would match because «!» is not in the group.
Why special characters are not allowed in SQL table column name?
I created a table and named one of the columns as 50″ the SQL accepted it but later when I right click on the table then click on «edit top 200 rows» the SQL Management studio stuck and stops working and closes.
However I still can edit other tables which don’t have special characters in their column name. It sounds like the » is not allowed in column name? Any idea how can I include » in column name?
2 Answers 2
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
That said, you do not want to have such names in your database. The use of square braces (in SQL Server, other databases have different escape mechanisms) just clutters up queries, making them harder to write and to read.
Why does SQL have such limitations? Well, in fact, it is a computer language and all computer languages (I think) have such limitations. For instance, an unescaped space is not allowed in a variable name in any language I can think of (some exceptions will be noted in the comments ;).
SQL could pretty easily allow more characters in names (for instance, I don’t think
Компьютерный перевод
Обучается переводу с помощью примеров, переведенных людьми.
English
Russian
Информация
English
special characters are not allowed in description
Russian
Переводы пользователей
Добавлены профессиональными переводчиками и компаниями и на основе веб-страниц и открытых баз переводов.
Английский
Русский
Информация
Английский
not valid, special characters are not allowed
Русский
Неверно; специальные символы не разрешены
Последнее обновление: 2013-05-30
Частота использования: 1
Качество:
Источник: Translated.com
Английский
children are not allowed in.
Русский
Детям вход воспрещён.
Последнее обновление: 2014-02-01
Частота использования: 1
Качество:
Источник: Translated.com
Английский
are not allowed
Русский
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
are not allowed.
Русский
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed
Русский
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed
Русский
Домашние животные запрещены
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed
Русский
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed
Русский
Размещение домашних животных не допускается.
Последнее обновление: 2018-02-21
Частота использования: 2
Качество:
Источник: Translated.com
Английский
pets are not allowed
Русский
Домашние животные не разрешены
Последнее обновление: 2018-02-21
Частота использования: 2
Качество:
Источник: Translated.com
Английский
pets are not allowed in a suite.
Русский
Домашние питомцы не разрешены в номере свит.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed in the hotel.
Русский
Проживание в отеле с животными запрещено.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed in the hotel.
Русский
Размещение с домашними животными запрещено.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed in the restaurant.
Русский
Вход в ресторан с домашними животными запрещен.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed in the restaurant.
Русский
Животные в ресторан не допускаются
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
pets are not allowed.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
В апартаменты нельзя привозить животных.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
В коттеджах «poiju villat» нельзя размещаться с домашними животными.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
Возможно размещение с домашними животными до 5 кг.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
Домашние животные не допускается.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Английский
pets are not allowed.
Русский
Животные не допускаются.
Последнее обновление: 2018-02-21
Частота использования: 1
Качество:
Источник: Translated.com
Получите качественный перевод благодаря усилиям
4,401,923,520 пользователей
Сейчас пользователи ищут:
MyMemory — крупнейшая в мире память переводов. Она была создана на основе систем памяти переводов Европейского Союза, Организации Объединенных Наций и ведущих специализированных многоязычных сайтов из разных отраслей.
Мы относимся к Translated, так что, если вам нужны услуги профессионального перевода, посетите наш основной сайт.
Источники информации:
- http://support.microsoft.com/en-us/topic/certain-special-characters-are-not-allowed-in-the-url-entered-into-the-address-bar-of-internet-explorer-a8e2a966-19d6-27af-06cc-e720f25e8b02
- http://stackoverflow.com/questions/14106109/how-do-i-not-allow-special-characters-but-allow-space-in-regex
- http://stackoverflow.com/questions/34531214/why-special-characters-are-not-allowed-in-sql-table-column-name
- http://mymemory.translated.net/ru/%D0%90%D0%BD%D0%B3%D0%BB%D0%B8%D0%B9%D1%81%D0%BA%D0%B8%D0%B9/%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9/special-characters-are-not-allowed-in-description