alphanumeric

Removing non alphanumeric characters in a batch variable

自作多情 提交于 2019-11-30 15:42:33
In batch, how would I remove all non alphanumeric (a-z,A-Z,0-9,_) characters from a variable? I'm pretty sure I need to use findstr and a regex. The solutionof MC ND works, but it's really slow (Needs ~1second for the small test sample). This is caused by the echo "!_buf!"|findstr ... construct, as for each character the pipe creates two instances of cmd.exe and starts findstr . But this can be solved also with pure batch. Each character is tested if it is in the map variable :test set "_input=Th""i\s&& is not good _maybe_???" set "_output=" set "map=abcdefghijklmnopqrstuvwxyz 1234567890"

Postgresql sorting mixed alphanumeric data

妖精的绣舞 提交于 2019-11-30 08:58:59
Running this query: select name from folders order by name returns these results: alphanumeric a test test 20 test 19 test 1 test 10 But I expected: a test alphanumeric test 1 test 10 test 19 test 20 What's wrong here? Grzegorz Szpetkowski You can simply cast name column to bytea data type allowing collate-agnostic ordering: SELECT name FROM folders ORDER BY name::bytea; Result: name -------------- a test alphanumeric test 1 test 10 test 19 test 20 (6 rows) You may be able to manually sort by splitting the text up in case there is trailing numerals, like so: SELECT * FROM sort_test ORDER BY

How to sort number in alphanumeric

∥☆過路亽.° 提交于 2019-11-29 20:00:11
问题 Input: SHC 111U,SHB 22x,, SHA 5555G Needed output: SHB 22X, SHC 111U, SHA 5555G I have to sort only Vehicle no in the Parking Area not prefix and suffix letter 回答1: Fantastic, well-optimized open source solution at http://dotnetperls.com/alphanumeric-sorting 回答2: There is nothing built-in to do this, but you can do it by first extracting the numbers and sorting based on that. For example: class VehicleNumberComparer : IComparer<string> { public int Compare(string lhs, string rhs) { var

Alphanumeric Order By in Mysql

隐身守侯 提交于 2019-11-29 11:56:28
How can i make only numeric order by when the column containing alphanumeric characters in mysql ? column (name) is unique field. my table contains the records, id name 1 ab001 2 ab010 3 aa002 4 ac004 5 ba015 6 ba006 7 aa005 8 ac003 The results must be like this, id name 1 ab001 3 aa002 8 ac003 4 ac004 7 aa005 6 ba006 2 ab010 5 ba015 When I am trying this query Select * from test order by name , I am getting the results order by alpha characters only. How do I get this ? Mark Byers Assuming your strings always end with 3 digits you could use RIGHT : SELECT id, name FROM Table1 ORDER BY RIGHT

only allow English characters and numbers for text input

强颜欢笑 提交于 2019-11-28 18:55:46
Live Demo: http://jsfiddle.net/thisizmonster/DveuB/ How can I change this so that the input only allows the characters A-Z, a-z, 0-9 while typing, without using a regular expression? Assuming you also want to accept spaces: $("#user").keypress(function(event){ var ew = event.which; if(ew == 32) return true; if(48 <= ew && ew <= 57) return true; if(65 <= ew && ew <= 90) return true; if(97 <= ew && ew <= 122) return true; return false; }); If you don't want to accept spaces then remove the if(ew == 32) return true; JSFiddle <input type="text" id="firstName" onkeypress="return (event.charCode >=

Sort AlphaNumeric with structured references in Excel

限于喜欢 提交于 2019-11-28 14:32:33
I Have an Excel Sheet with data that looks like that. Data x=1.1 x=11.2 x=10.3 x=1.4 x=2.5;2.6 x=2.1 x=4.7 x=6.8 x=6.2;6.3 x=1.10 What i want to do is, to sort the List that it Looks like that. DataSort x=1.1 x=1.4 x=1.10 x=2.1 x=2.5;2.6 x=4.7 x=6.2;6.3 x=6.8 x=10.3 x=11.2 I tried to do that with that Formula =LEFT(Tabelle1[[#this row];[Data]];2) & TEXT(SUBSTITUTE(Tabelle1[[#this row];[Data]];LEFT(Tabelle1[[#this row];[Data]];2);"");"#0.0#") But that did not work. Can someone give me a hint to the right Direction? Copy the data into a new column say B If you are using excel 2007 or higher, go

Allow only alphanumeric in textbox

别来无恙 提交于 2019-11-28 10:50:46
I have a textbox that should disallow entering any special characters. The user can enter : A-Z a-z 0-9 Space How can I make the KeyDown event to do this? private void _txtPath_KeyDown(object sender, KeyEventArgs e) { if ((e.Key < Key.A) || (e.Key > Key.Z)) e.Handled = true; } Handling the KeyDown or KeyPress events is one way to do this, but programmers usually forget that a user can still copy-and-paste invalid text into the textbox. A somewhat better way is to handle the TextChanged event, and strip out any offending characters there. This is a bit more complicated, as you have to keep

HTML5 form validation pattern alphanumeric with spaces?

為{幸葍}努か 提交于 2019-11-28 06:11:16
I have the following input tag in my html5 form: <p> <label>Company Name*</label> <input type="text" name="name" class="field" required pattern="[a-zA-Z0-9]+" /> </p> This works just fine checking if the company name consists out of alphanumeric characters. But of course I want to allow spaces in the company name. I need to know what I should add to the pattern. How about adding a space in the pattern attribute like pattern="[a-zA-Z0-9 ]+" . If you want to support any kind of space try pattern="[a-zA-Z0-9\s]+" My solution is to cover all the range of diacritics: ([A-z0-9À-ž\s]){2,} A-z - this

Alphanumeric Order By in Mysql

痴心易碎 提交于 2019-11-28 06:02:32
问题 How can i make only numeric order by when the column containing alphanumeric characters in mysql ? column (name) is unique field. my table contains the records, id name 1 ab001 2 ab010 3 aa002 4 ac004 5 ba015 6 ba006 7 aa005 8 ac003 The results must be like this, id name 1 ab001 3 aa002 8 ac003 4 ac004 7 aa005 6 ba006 2 ab010 5 ba015 When I am trying this query Select * from test order by name , I am getting the results order by alpha characters only. How do I get this ? 回答1: Assuming your

How to check if a string only contains alphanumeric characters in objective C?

回眸只為那壹抹淺笑 提交于 2019-11-28 04:05:19
I'm working on a small iphone project and i would need to check if the userName entered only contains alphanumerical characters? (A-Z, a-z, 0-9 . How would i go about checking it? Jason Harwig If you don't want to bring in a regex library for this one task... NSString *str = @"aA09"; NSCharacterSet *alphaSet = [NSCharacterSet alphanumericCharacterSet]; BOOL valid = [[str stringByTrimmingCharactersInSet:alphaSet] isEqualToString:@""]; NSResponder This will work: @implementation NSString (alphaOnly) - (BOOL) isAlphaNumeric { NSCharacterSet *unwantedCharacters = [[NSCharacterSet