#escaping #string-literal #string #character

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

#56 in Text processing

Download history 36695/week @ 2024-07-20 37013/week @ 2024-07-27 37335/week @ 2024-08-03 38771/week @ 2024-08-10 38207/week @ 2024-08-17 31413/week @ 2024-08-24 33605/week @ 2024-08-31 32862/week @ 2024-09-07 34241/week @ 2024-09-14 39370/week @ 2024-09-21 32070/week @ 2024-09-28 41769/week @ 2024-10-05 43150/week @ 2024-10-12 42940/week @ 2024-10-19 37273/week @ 2024-10-26 29676/week @ 2024-11-02

159,777 downloads per month
Used in 361 crates (16 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

~245–700KB
~16K SLoC