Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ specific condition:

```powershell
$var = "word2"
switch -regex ($var) {
switch -Regex ($var) {
"word2" {
Write-Host "Exact" $_
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ condition obtains, the action is performed.
Syntax 1:

```Syntax
switch [-regex|-wildcard|-exact][-casesensitive] ( <value> )
switch [-Regex|-Wildcard|-Exact][-CaseSensitive] ( <value> )
{
<string>|<number>|<variable>|{ <expression> } {<statement list>}
<string>|<number>|<variable>|{ <expression> } {<statement list>}
Expand All @@ -487,7 +487,7 @@ switch [-regex|-wildcard|-exact][-casesensitive] ( <value> )
Syntax 2:

```Syntax
switch [-regex|-wildcard|-exact][-casesensitive] -file <filename>
switch [-Regex|-Wildcard|-Exact][-CaseSensitive] -File <filename>
{
<string>|<number>|<variable>|{ <expression> } {<statement list>}
<string>|<number>|<variable>|{ <expression> } {<statement list>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ more about their syntax and usage at the links below.
- [Select-String][11]
- [-match and -replace operators][07]
- [-split operator][09]
- [switch statement with -regex option][10]
- [switch statement with -Regex option][10]

PowerShell regular expressions are case-insensitive by default. Each method
shown above has a different way to force case sensitivity.
Expand Down
Loading