Docs: Prepend regex patterns in C# with @

Created on 8 Oct 2019  Â·  7Comments  Â·  Source: dotnet/docs

A couple of articles show the regex example without using the string literal special character (\@).

I find this harder to validate the pattern. So the article linked here as an example, you could change the line from

"\\b(?<month>\\d{1,2})/(?<day>\\d{1,2})/(?<year>\\d{2,4})\\b",

to

@"\b(?<month>\d{1,2})/(?<day>\d{1,2})/(?<year>\d{2,4})\b",

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - .NET Guide P2 Pri2 doc-enhancement dotnet-standartech dotneprod up-for-grabs

All 7 comments

Hi, anyone is working on this issue?

@MetalDent No one is working on this yet. Do you want to submit a PR? Either @mairaw or I can help with any questions.

@BillWagner you want to change the expressions in the specified article or others also (if present)?

@MetalDent I recommend starting with this article. @mairaw can point to others that should be updated as well.

@BillWagner the example links in the Content-Source link are not found. Should I update them?

@MetalDent Most of the sample code is in our dotnet/samples repository. The docs build clones both repositories and combines them. For example, the first sample in the content source is here.

That does mean fixing an article + an associated sample requires 2 pull requests: one in docs, and another in dotnet/samples.

Hi @BillWagner , i was looking for the link that you sent before. I couldn't find anything else to change. Am I missing something? Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stjepan picture stjepan  Â·  3Comments

stanuku picture stanuku  Â·  3Comments

Eilon picture Eilon  Â·  3Comments

sime3000 picture sime3000  Â·  3Comments

svick picture svick  Â·  3Comments