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

Removed ` character from if statement with Regex #66

Open
beancurd1 opened this issue Mar 19, 2022 · 0 comments
Open

Removed ` character from if statement with Regex #66

beancurd1 opened this issue Mar 19, 2022 · 0 comments

Comments

@beancurd1
Copy link

beancurd1 commented Mar 19, 2022

Thanks for making this great script, this is the only beautifier I could find online so far.
I installed PowerShell-Beautifier yesterday. I found a small issue when running your it, it converted most of my scripts fine except the following samples. It removed ` character from the if statement. I did a BeyondCompare to find that out. You can use the following sample to reproduce the issue. Thanks for looking into it.
Interesting, I just noticed I need to use \ to escape ` in the sample below, otherwise it won't show on github ~~~ so both github and PowerShell-Beautifier seemed to ignore it :)

SAMPLE

if ($line -match "[0-3]?\d[/| |-][ADFJMNOS]\w{2,9}[/| |-]\d{2,4}" -or ` # break the loop if an incorrect date ' MMM yyyy', ' MMMM yyyy', '-MMM-yy' format are found.
$line -match "[0-3]?\d/\d?\d/\d{2,4}" ) { ` # OR break the loop if an incorrect date format dd/mm/yyyy is found.
write-host "test"
}

@beancurd1 beancurd1 changed the title Removed ` character from if statement Removed ` character from if statement with Regex Apr 16, 2022
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