Comment

Comment by devit

That seems rather trivial, and I'm not sure how you could possibly have any issues with the borrow checker.

Just do the first regex search, then escape into a String with regex::escape, then build a regex from the String and search with it.

Of course what you are doing is probably wrong since you should use a string matching crate rather than escaping characters and using a regex matching crate.

parent devit 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton