Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl regexp with /x switch #3958

Open
Solathian opened this issue Dec 1, 2022 · 0 comments
Open

Perl regexp with /x switch #3958

Solathian opened this issue Dec 1, 2022 · 0 comments

Comments

@Solathian
Copy link

Solathian commented Dec 1, 2022

Short Summary

In Perl a \x switch enables whitespaces inside a regexp
The characters after a '#' and between the linebreak are not considered as comments in terms of formatting.

Steps to Reproduce

Create a regexp with \x switch and add comments into it.
For example:
m/^(.{2}) # $byteLow 1 byte - any two characters after start
(.{2}) # $byteHigh 1 byte - any two characters
.{6} # - any 6 characters
$/x; # line end, x to enable whitespaces in regexp

Expected results

Every character shall be formatted as a comment between the # and the linebreak in the regexp, if the \x switch is enabled.

Actual results

The entire line has regexp format, even if a # is present with the \x switch.
See attached screenshot.

Platform Information

Komodo Edit, version 12.0.1, build 18441, platform win32-x86. Built on Tue Feb 11 04:14:27 2020.

Additional Information

https://perldoc.perl.org/perlre#/x-and-/xx
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant