Skip to content

regex! docs should have an example of using # for raw string literals #17023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfager opened this issue Sep 5, 2014 · 4 comments · Fixed by #18695
Closed

regex! docs should have an example of using # for raw string literals #17023

jfager opened this issue Sep 5, 2014 · 4 comments · Fixed by #18695

Comments

@jfager
Copy link
Contributor

jfager commented Sep 5, 2014

Raw strings aren't the heaviest advertised feature of Rust, and users of raw strings in some other languages might be surprised at how " characters need to be handled.

@gamazeps
Copy link
Contributor

gamazeps commented Sep 6, 2014

Anyone on this one ? If not I'm on it ;)

@gamazeps
Copy link
Contributor

gamazeps commented Sep 7, 2014

It's a bit tougher than expected ...
Not on it for now ;)

@steveklabnik
Copy link
Member

In the first section, it has this paragraph:

This example also demonstrates the utility of raw strings in Rust, which are just like regular strings except they are prefixed with an r and do not process any escape sequences. For example, "\d" is the same expression as r"\d".

Is this not enough? What do you suggest?

@jfager
Copy link
Contributor Author

jfager commented Sep 9, 2014

Raw strings with quotes have to be bounded with #, like r#""hello""#.
This isn't immediately obvious, especially for someone coming from, say,
Python. An example showing this usage explicitly or a link to raw string
documentation would be nice.

On Monday, September 8, 2014, Steve Klabnik notifications@github.com
wrote:

In the first section, it has this paragraph:

This example also demonstrates the utility of raw strings in Rust, which
are just like regular strings except they are prefixed with an r and do not
process any escape sequences. For example, "\d" is the same expression as
r"\d".

Is this not enough? What do you suggest?


Reply to this email directly or view it on GitHub
#17023 (comment).

steveklabnik added a commit to steveklabnik/rust that referenced this issue Nov 6, 2014
lnicola pushed a commit to lnicola/rust that referenced this issue Apr 7, 2024
lnicola pushed a commit to lnicola/rust that referenced this issue Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants