Support searching for numeric literals with digit separators in GitHub Code Search #129896
-
Select Topic AreaQuestion BodyHello GitHub Team, I am writing to request an enhancement to the GitHub Code Search functionality. Specifically, I would like to see support for searching numeric literals with digit separators (underscores) in addition to the standard numeric format. Current Limitation: Currently, when searching for a numeric value such as Feature Request: I propose that GitHub Code Search be enhanced to:
Benefits:
Example: A search for Thank you for considering this enhancement. I believe it would significantly improve the usability of GitHub Code Search for many developers. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the suggestion. I recommend using a regular expression for this use case. For example, to search for variations of 1,000,000 you could use: |
Beta Was this translation helpful? Give feedback.
Thanks for the suggestion. I recommend using a regular expression for this use case.
For example, to search for variations of 1,000,000 you could use:
/1[_,0]{6,}/
. This isn't exactly what you want: it will match100_000
since it has 6 characters after the1
just like1000000
does. However, it will narrow the search space considerably. If there's a format regularly used in your codebase, you could provide a stricter regular expression.