#escaping #string

unescaper

Unescape strings with escape sequences written out as literal characters

6 releases

0.1.5 Jun 26, 2024
0.1.4 Jan 23, 2024
0.1.3 Nov 24, 2023
0.1.2 Aug 20, 2023
0.1.1 Aug 9, 2022

#61 in Text processing

Download history 27971/week @ 2024-04-05 30856/week @ 2024-04-12 27529/week @ 2024-04-19 27802/week @ 2024-04-26 29390/week @ 2024-05-03 28977/week @ 2024-05-10 30033/week @ 2024-05-17 27161/week @ 2024-05-24 28473/week @ 2024-05-31 27405/week @ 2024-06-07 29902/week @ 2024-06-14 32379/week @ 2024-06-21 30581/week @ 2024-06-28 32348/week @ 2024-07-05 31606/week @ 2024-07-12 29784/week @ 2024-07-19

130,527 downloads per month
Used in 311 crates (11 directly)

GPL-3.0/MIT

18KB
192 lines

Unescaper

Unescape strings with escape sequences written out as literal characters.

License GPLv3 License MIT Checks GitHub tag (latest by date) GitHub code lines GitHub last commit

Usage

More Examples

fn main() {
	assert_eq!(unescaper::unescape(r"\u000a").unwrap(), "\n");
	assert_eq!(unescaper::unescape(r"\u{a}").unwrap(), "\n");
	assert_eq!(unescaper::unescape(r"\x0a").unwrap(), "\n");
	assert_eq!(unescaper::unescape(r"\12").unwrap(), "\n");
}

Thanks

The idea comes from unescape-rs.
The last commit of that repository was seven years ago.
So, I think it is no longer maintained.
That's why I created this repository, and I have made some improvements.

Dependencies

~280–740KB
~17K SLoC