C-Like Single Line Comment Regex Matches Double Slash in Strings
See original GitHub issueThe single line comment pattern /(^|[^\\:])\/\/.*/
incorrectly matches the double slash in the string:
final String rcal = "ejb:jboss-ejb-multi-server-app-main/ejb//" + ("MainAppBean") + "!" + MainApp.class.getName();
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to REGEX // in C? Single line comments - Stack Overflow
A single-line comment expression starting with '//' can be captured by the following regular expression. \/\/[^\r\n]*. \/\/ matches the double-slash
Read more >Single-Line Comments - Regular Expressions Cookbook, 2nd ...
Single -Line Comments Problem You want to match a comment that starts with ... Some programming languages use forward slashes to delimit regular...
Read more >Finding Comments in Source Code Using Regular Expressions
Regular expressions are greedy, they take in as much as they can. Consider the case in which your file has two comments. This...
Read more >Remove double-slash comments - regex101
Are you sure you want to delete this regex? This action is non-reversible and will delete all versions of this regex. The data...
Read more >Regular expressions
Regular expressions are the default pattern engine in stringr. ... Like strings, regexps use the backslash, \ , to escape special behaviour. So...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The key difference would probably be the addition of the
greedy
key on thestring
pattern, rather than a change in thecomment
pattern. Please keep us informed if the issue is fixed.Hi! Thanks for reporting. I don’t reproduce the issue on the test page. Can you make sure you’re using the last version of Prism please?