Skip to content

Commit 92fdf17

Browse files
authored
Update regex in how-to-rename-azure-ad.md
Various regex fixes The pattern `[a-z|0-1]*` only matches letters and `|`, `0` and `1`. It should be changed to `[a-z0-9/-]*`. I am not sure about the intention for `name="[^$]*`, but it currently matches an unlimited number of non `$` characters. Finally slashes (`/`) does not need to be escaped in PowerShell. I also limited the number of repeats, to reduce execution time.
1 parent 80c36f8 commit 92fdf17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

articles/active-directory/fundamentals/how-to-rename-azure-ad.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ function Update-Terminology {
332332
foreach ($item in $Terminology.GetEnumerator()) {
333333
$old = [regex]::Escape($item.Key)
334334
$new = $item.Value
335-
$toReplace = '(?<!(name=\"[^$]*|https?:\/\/aka.ms/[a-z|0-1]*))' + $($old)
335+
$toReplace = '(?<!(name=\"[^$]{1,100}|https?://aka.ms/[a-z0-9/-]{1,100}))' + $($old)
336336
337337
# Replace the old terminology with the new one
338338
$Content.Value = $Content.Value -replace $toReplace, $new

0 commit comments

Comments
 (0)