#escape #unescape #string

unescaper

Unescape strings with escape sequences written out as literal characters

2 releases

0.1.1 Aug 9, 2022
0.1.0 Aug 9, 2022

#430 in Text processing

Download history 23/week @ 2022-12-04 22/week @ 2022-12-11 63/week @ 2022-12-18 33/week @ 2022-12-25 180/week @ 2023-01-01 205/week @ 2023-01-08 251/week @ 2023-01-15 334/week @ 2023-01-22 470/week @ 2023-01-29 370/week @ 2023-02-05 916/week @ 2023-02-12 952/week @ 2023-02-19 1005/week @ 2023-02-26 1072/week @ 2023-03-05 1125/week @ 2023-03-12 3069/week @ 2023-03-19

6,323 downloads per month
Used in 11 crates (2 directly)

GPL-3.0 license

17KB
181 lines

Unescaper

Unescape strings with escape sequences written out as literal characters.

License 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

~0.6–1MB
~25K SLoC