Questions tagged [alphanumeric]

Alphanumeric refers to strings containing a combination of letters and digits.

Alphanumeric refers to strings containing a combination of letters and digits.

In the context of English language, it contains characters lowercase a to z, uppercase A to Z and digits 0 to 9. It may contain more letters in other languages.

707 questions
14
votes
4 answers

html 5 input type for alphanumeric on mobile keyboard

We have seen when input type "Text" selected on mobile keyboard it comes up with text, when input type "number" selected on mobile keyboard it comes up with numbers only. And when input type password fields are selected then it comes up with both…
Touhidul Alam
  • 321
  • 2
  • 11
14
votes
3 answers

Replace non alphanumeric characters except some exceptions python

In perl s/[^\w:]//g would replace all non alphanumeric characters EXCEPT : In python I'm using re.sub(r'\W+', '',mystring) which does remove all non alphanumeric except _ underscore. Is there any way to put exceptions, I wish not to replace signs…
pythonRcpp
  • 2,042
  • 6
  • 26
  • 48
14
votes
3 answers

Bash need to test for alphanumeric string

Trying to verify that a string has only lowercase, uppercase, or numbers in it. if ! [[ "$TITLE" =~ ^[a-zA-Z0-9]+$ ]]; then echo "INVALID"; fi Thoughts? * UPDATE * The variable TITLE currently only has upper case text so it should pass and nothing…
Atomiklan
  • 5,164
  • 11
  • 40
  • 62
11
votes
1 answer

RegEx (in JavaScript find/replace) - match non-alphanumeric characters but ignore - and +

We have been using the following js/regex to find and replace all non-alphanumeric characters apart from - and + outputString = outputString.replace(/[^\w|^\+|^-]*/g, ""); However it doesn't work entirely - it doesn't replace the ^ and | characters.…
Phil Baines
  • 205
  • 4
  • 10
11
votes
3 answers

Generating Alphanumeric random string in Java

I am using String Builder from another answer, but I can't use anything but alpha/numeric, no whitespace, punctuation, etc. Can you explain how to limit the character set in this code? Also, how do I insure it is ALWAYS 30 characters long? …
PrivusGuru
  • 273
  • 1
  • 2
  • 12
9
votes
8 answers

Check if User Inputs a Letter or Number in C

Is there an easy way to call a C script to see if the user inputs a letter from the English alphabet? I'm thinking something like this: if (variable == a - z) {printf("You entered a letter! You must enter a number!");} else (//do something} I want…
Tater
8
votes
2 answers

EditText input with pattern android

I am having a EditText in which I have to accept alphanumeric input from user which is specific to pattern, and hyphens '-' are inserted automatically. "XXX-XXX-XXXX" how to achieve that ? Is there any pattern tool in android ?
Shardul
  • 786
  • 3
  • 11
  • 20
8
votes
2 answers

python regex add space whenever a number is adjacent to a non-number

I am trying to separate non-numbers from numbers in a Python string. Numbers can include floats. Examples Original String Desired String '4x5x6' '4 x 5 x 6' '7.2volt' '7.2 volt' '60BTU' …
Alejandro Simkievich
  • 3,512
  • 4
  • 33
  • 49
7
votes
3 answers

Alpha-numeric sequence in SQL Server

I need to generate a 3 character alphanumeric sequence, in SQL Server 2008, as follows: 001, 002, ..., 999, A01, A02, ..., A99, B01, B02, ..., Z99 The next item in the sequence will get generated from a stored procedure and stored in a NCHAR(3)…
kjv
  • 11,047
  • 34
  • 101
  • 140
7
votes
4 answers

XSLT Sort Alphabetically & Numerically Problem

I have a group of strings ie g:lines = '9,1,306,LUCY,G,38,12' I need the output to be in XSLT 1.0: 1,9,12,38,306,G,LUCY This is my current code:
Bryan
  • 73
  • 1
  • 4
7
votes
6 answers

Python code to use a regular expression to make sure a string is alphanumeric plus . - _

I looked and searched and couldn't find what I needed although I think it should be simple (if you have any Python experience, which I don't). Given a string, I want to verify, in Python, that it contains ONLY alphanumeric characters: a-zA-Z0-9 and…
Warlax
  • 2,459
  • 5
  • 30
  • 41
6
votes
1 answer

Sort list with alphanumeric items by letter first

I have such a list with alphanumeric items: ['A08', 'A09', 'A02', 'A03', 'A06', 'A07', 'A04', 'A05', 'A15', 'A14', 'A17', 'A16', 'A11', 'B01', 'B03', 'B02', 'B05', 'B04', 'B07', 'B06', 'B09', 'B08', 'B16', 'B17', 'B14', 'B15', 'C05', 'C06',…
Anna
  • 271
  • 1
  • 3
  • 10
6
votes
4 answers

Removing spaces and anything that is not alphanumeric

I'm trying to remove everything that is not alphanumeric, or is a space with _: $filename = preg_replace("([^a-zA-Z0-9]|^\s)", "_", $filename); What am I doing wrong here, it doesn't seem to work. I've tried several regex combinations...(and I'm…
jonnnnnnnnnie
  • 1,219
  • 3
  • 15
  • 24
6
votes
3 answers

How to custom sort an alphanumeric list?

I have the following list l = ['SRATT', 'SRATW', 'CRAT', 'CRA0', 'SRBTT', 'SRBTW', 'SRAT0', 'SRBT0'] which I would like to sort alphabetically, with the added rule that a string containing a number at the end (actually always 0) must come after the…
Demosthene
  • 359
  • 1
  • 4
  • 16
6
votes
4 answers

Why do sites use random alphanumeric ids rather than database ids to identify content?

Why do sites like YouTube, Imgur and most others use random characters as their content ids rather than just sequential numbers, like those created by auto-increment in MySQL? To explain what I mean: In the URL:…
1 2
3
47 48