Thanks in advance.
I would like the regex to remove anything that is not the letter α and the hyphen. So allowed are AZ 0-9 and -.
Also, how can I apply this to a string in Javascript?
Thanks again.
var str = 'a23a-asd!@#$'; str.replace(/[^-a-z0-9]/ig,'');
Try the following:
str = str.replace(/[a-zA-Z\d-]/g, "");
var output = input.replace(/[^A-Za-z0-9-]/g, "");
string.replace(/[^ a-zA-Z0-9 -]/g, "");
$(document).ready(function (e) { $('#Box, #Window').keyup(function(){ var $th = $(this); $th.val($th.val().replace(/[^a-zA-Z0-9]/g, function(str){return '';})); }); });
- .
Source: https://habr.com/ru/post/1718714/More articles:Автоматическое изменение размера TableLayoutPanel - .netWCF could not load reference assemblies from the GAC - c #The "assembly" section of the configuration section cannot be read because the section declaration is missing - c #Online or Free Learning Resources for Silverlight Styling - stylingSet axis label marks in gnuplot - gnuplotUse an argument in an EL expression - faceletsHaskell cyclic behavior detection - haskellUserControl - доступ к текстовому полю в UserControl в веб-форме - c#Using stack pointer r1 when handling an external exception on PowerPC - assemblyScroll bars not showing in new window - javascriptAll Articles