What exactly is a “raw string regex” and how can you use it?

Zarkonnen’s response does answer your question, but not directly. Let me try to be more direct, and see if I can grab the bounty from Zarkonnen. You will perhaps find this easier to understand if you stop using the terms “raw string regex” and “raw string patterns”. These terms conflate two separate concepts: the representations … Read more

Raw Strings in Java – for regex in particular. Multiline strings

This is a work-around if you are using eclipse. You can automatically have long blocks of text correctly multilined and special characters automatically escaped when you paste text into a string literal “-paste here-“; if you enable that option in window→preferences→java→Editor→Typing→”Escape text when pasting into a string literal”

Why can’t Python’s raw string literals end with a single backslash?

The whole misconception about python’s raw strings is that most of people think that backslash (within a raw string) is just a regular character as all others. It is NOT. The key to understand is this python’s tutorial sequence: When an ‘r‘ or ‘R‘ prefix is present, a character following a backslash is included in … Read more

What exactly do “u” and “r” string prefixes do, and what are raw string literals?

There’s not really any “raw string“; there are raw string literals, which are exactly the string literals marked by an ‘r’ before the opening quote. A “raw string literal” is a slightly different syntax for a string literal, in which a backslash, \, is taken as meaning “just a backslash” (except when it comes right … Read more