#escape #string #unescape

unescaper

Unescape strings with escape sequences written out as literal characters

5 releases

0.1.4 Jan 23, 2024
0.1.3 Nov 24, 2023
0.1.2 Aug 20, 2023
0.1.1 Aug 9, 2022
0.1.0 Aug 9, 2022

#102 in Date and time

Download history 12117/week @ 2023-10-29 15365/week @ 2023-11-05 14649/week @ 2023-11-12 13502/week @ 2023-11-19 11077/week @ 2023-11-26 10501/week @ 2023-12-03 13645/week @ 2023-12-10 15270/week @ 2023-12-17 9795/week @ 2023-12-24 13788/week @ 2023-12-31 16557/week @ 2024-01-07 17328/week @ 2024-01-14 19500/week @ 2024-01-21 21907/week @ 2024-01-28 24860/week @ 2024-02-04 21999/week @ 2024-02-11

89,249 downloads per month
Used in 244 crates (6 directly)

GPL-3.0/MIT

18KB
191 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

~305–750KB
~18K SLoC