firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.21k stars 198 forks source link

.NET: swap "null" for "empty string" or similar on empty matches #2008

Closed qrjo closed 1 year ago

qrjo commented 1 year ago

Bug Description

When a regex or subgroup matches an empty string this shows up in the match information panel as "null" (in italics). However, .NET doesn't actually return null as value for the match, but an empty string. This is confusing. I think it would be clearer if the match information showed "empty string" in italics or something similar.

Reproduction steps

  1. Set flavor to .NET (C#)
  2. Set regex to a?
  3. Check the match information panel: it shows match 1 as null

https://regex101.com/?flavor=dotnet&regex=a?

Expected Outcome

The match should show as empty string or something similar.

firasdib commented 1 year ago

Thank you for the suggestion, I will update this in the next release.