3

I would like to include a link in an answer to the following URL:

https://msdn.microsoft.com/en-us/library/20bw873z(v=vs.110).aspx#Decimal Digit Character: \d

Note that the hash is supposed to go all the way to the end of the line, including the spaces, colon, and backslash. How on earth do I accomplish that? URLEncoding the hash doesn't work. Using an html anchor tag doesn't work (it URLEncodes the hash, too).

Here's an example attempt:

[\d Regex character class in C#](https://msdn.microsoft.com/en-us/library/20bw873z(v=vs.110).aspx#Decimal Digit Character: \d)

I also tried %20 in place of the spaces, and +, but none of them navigate to the correct section.

2
  • %20 seems to work for me: \d Regex character class in C#. Though it looks like the link should actually be https://msdn.microsoft.com/en-us/library/20bw873z(v=vs.110).aspx#DigitCharacter.
    – Mike M.
    Commented Apr 29, 2017 at 1:00
  • 1
    @MikeM. You beat me by 4 seconds... I found out the same things as you, sorry to waste your time.
    – ErikE
    Commented Apr 29, 2017 at 1:01

1 Answer 1

1

Well, that was fast.

The answer is: use %20 in place of spaces, as spaces are not valid in this part of a URL. Also / needs to be encoded as %5d.

I figured out that when navigating using the links on the right side of the linked page, the hash that is placed in the URL is part of some javascript page navigation and doesn't actually refer to an id within the page, so nothing I could have done to the above hash value would have made it work. There IS a usable id in the page, though, so hash #DigitCharacter will work for my link. Using percent hex encoding should theoretically have worked, if the page was actually "listening" to the hash value, which it isn't.

Example link that should work, and can be put into a manual link using markdown:

https://msdn.microsoft.com/en-us/library/20bw873z(v=vs.110).aspx#Decimal%20Digit%20Character:%20%5cd

I'm not deleting my question because it might help someone else.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .