-
Notifications
You must be signed in to change notification settings - Fork 22.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glossary term 'escaping text' (#37444)
* Add glossary term 'escaping text' * Apply suggestions from code review Co-authored-by: Estelle Weyl <[email protected]> * Apply suggestions from code review Co-authored-by: Joshua Chen <[email protected]> * Update files/en-us/glossary/escaping_text/index.md Co-authored-by: Joshua Chen <[email protected]> * Apply suggestions from code review * fix: name changes * Update index.md * Update files/en-us/glossary/escape_character/index.md Co-authored-by: Joshua Chen <[email protected]> * Apply suggestions from code review Co-authored-by: Estelle Weyl <[email protected]> --------- Co-authored-by: Estelle Weyl <[email protected]> Co-authored-by: Joshua Chen <[email protected]>
- Loading branch information
1 parent
afaa8a0
commit bd74b8a
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: Escape character | ||
slug: Glossary/Escape_character | ||
page-type: glossary-definition | ||
--- | ||
|
||
{{GlossarySidebar}} | ||
|
||
An **escape character** is a {{glossary("character")}} that causes one or more characters that follow it to be interpreted differently. This forms an **escape sequence**, which is often used to represent a character that has an alternative meaning when printed literally, such as the quote character in a string literal. Escape sequences can have other usages too, especially in [regular expressions](/en-US/docs/Web/JavaScript/Reference/Regular_expressions#escape_sequences). | ||
|
||
- In JavaScript [regexes](/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_escape), [string literals](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#string_literals), and [identifiers](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers), we can use the backslash (`\`) to escape characters like `\'`, `\"`, `\u0026`, etc. | ||
- In CSS identifiers, we can use the backslash (`\`) to escape characters like `\\`, `\n`, `\26`, etc. See [escape characters](/en-US/docs/Web/CSS/ident#escaping_characters) for more information. | ||
- In HTML text content and attribute values, we can use {{glossary("character reference", "character references")}} like `<`, `<`, or `<`. | ||
- In {{glossary("URL", "URLs")}}, we can use the percent sign (`%`) to escape characters like `%20`, `%3C`, `%3E`, etc. | ||
|
||
## See also | ||
|
||
- Related glossary terms: | ||
- {{glossary("Character")}} | ||
- {{glossary("Character reference")}} | ||
- {{glossary("Code point")}} | ||
- [Escape character](https://en.wikipedia.org/wiki/Escape_character) on Wikipedia | ||
- [Escape sequence](https://en.wikipedia.org/wiki/Escape_sequence) on Wikipedia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters