Questions tagged [special-characters]

Special characters (as they apply to programming) are language-specific reserved characters or symbols used to accomplish a specific task (e.g. wildcard characters, data type indicators, escape characters, etc).

Every character is special in its own way. When talking about "special characters" in a question, be specific. Do you mean ASCII symbols, Japanese kana, or Egyptian hieroglyphs?

For example, when working with Unicode, characters from exotic scripts aren't more "special", technically, than characters from the ASCII range. If you mean characters that you can't enter directly with an US PC keyboard, you should probably use the term "non-ASCII characters" and avoid this tag.

5011 questions
501
votes
14 answers

How to write character & in android strings.xml

I wrote the following in the strings.xml file: Move by Drag&Drop I got the following error: The reference to entity "Drop" must end with the ';' delimiter. How can I write character & in…
Palo
  • 10,591
  • 7
  • 28
  • 34
329
votes
8 answers

Meaning of $? (dollar question mark) in shell scripts

What does echo $? mean in shell programming?
Harshay Buradkar
  • 3,493
  • 2
  • 15
  • 19
312
votes
10 answers

Remove all special characters with RegExp

I would like a RegExp that will remove all special characters from a string. I am trying something like this but it doesn’t work in IE7, though it works in Firefox. var specialChars = "!@#$^&%*()+=-[]\/{}|:<>?,."; for (var i = 0; i <…
Timothy Ruhle
  • 7,387
  • 10
  • 41
  • 67
312
votes
28 answers

Most efficient way to remove special characters from string

I want to remove all special characters from a string. Allowed characters are A-Z (uppercase or lowercase), numbers (0-9), underscore (_), or the dot sign (.). I have the following, it works but I suspect (I know!) it's not very efficient: …
ObiWanKenobi
  • 14,526
  • 11
  • 45
  • 51
301
votes
9 answers

What is the difference between \r and \n?

How are \r and \n different? I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure exactly how they're different, and which to search for/match in regexes.
Sam Lee
  • 9,913
  • 15
  • 48
  • 56
295
votes
10 answers

What is a vertical tab?

What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)? Did it ever have a key on a keyboard? How did someone generate it? Is there any language or system still in use today where the vertical tab…
dmazzoni
  • 12,866
  • 4
  • 38
  • 34
294
votes
7 answers

Which characters need to be escaped when using Bash?

Is there any comprehensive list of characters that need to be escaped in Bash? Can it be checked just with sed? In particular, I was checking whether % needs to be escaped or not. I tried echo "h%h" | sed 's/%/i/g' and worked fine, without escaping…
fedorqui
  • 275,237
  • 103
  • 548
  • 598
261
votes
13 answers

Remove all special characters except space from a string using JavaScript

I want to remove all special characters except space from a string using JavaScript. For example, abc's test#s should output as abcs tests.
nithi
  • 3,725
  • 2
  • 20
  • 18
224
votes
8 answers

Allowed characters in filename

Where can I find a list of allowed characters in filenames, depending on the operating system? (e.g., on Linux, the character : is allowed in filenames, but not on Windows)
python dude
  • 7,980
  • 11
  • 40
  • 53
209
votes
11 answers

How do I add a bullet symbol in TextView?

I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?
Pria
  • 2,743
  • 4
  • 27
  • 30
170
votes
10 answers

Get Character value from KeyCode in JavaScript... then trim

This is what I have now: $("input").bind("keydown",function(e){ var value = this.value + String.fromCharCode(e.keyCode); } If the e.keyCode may not be an ASCII character (Alt, backspace, del, arrows, etc.)... I would now need to trim these…
David Murdoch
  • 87,823
  • 39
  • 148
  • 191
150
votes
26 answers

How do I block or restrict special characters from input fields with jquery?

How do I block special characters from being typed into an input field with jquery?
Nerd Stalker
  • 1,509
  • 2
  • 10
  • 4
141
votes
12 answers

Converting Symbols, Accent Letters to English Alphabet

The problem is that, as you know, there are thousands of characters in the Unicode chart and I want to convert all the similar characters to the letters which are in English alphabet. For instance here are a few…
ahmet alp balkan
  • 42,679
  • 38
  • 138
  • 214
136
votes
5 answers

List of special characters for SQL LIKE clause

What is the complete list of all special characters for a SQL (I'm interested in SQL Server but other's would be good too) LIKE clause? E.g. SELECT Name FROM Person WHERE Name LIKE '%Jon%' SQL Server: % _ [specifier] E.g. [a-z] [^specifier] ESCAPE…
Jonathan Parker
  • 6,705
  • 3
  • 43
  • 54
136
votes
11 answers

Is a colon `:` safe for friendly-URL use?

We are designing a URL system that will specify application sections as words separated by slashes. Specifically, this is in GWT, so the relevant parts of the URL will be in the hash (which will be interpreted by a controller layer on the…
Nicole
  • 32,841
  • 11
  • 75
  • 101
1
2 3
99 100