1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
$reg='^(recruit_pool ".*") (0|1) (\d{1}.\d{1,}|\d{1,}) (.*)$'
$s=@(
'recruit_pool "Lindon Militia Cavalry" 0 0.035 1 0 requires factions { saxons, } and region_religion elven 33 and hidden_resource mountains or hidden_resource desert',
'recruit_pool "Lindon Militia Swordsmen" 1 0.06 1 0 requires factions { saxons, } and region_religion elven 33 and hidden_resource forest or hidden_resource grasland',
'_pool "Lindon Militia Cavalry" 0 0.035 1 0 requires factions { saxons, } and region_religion elven 33 and hidden_resource mountains or hidden_resource desert',
'recruit_pool "Lindon Militia Swordsmen" 2 0.06 1 0 requires factions { saxons, } and region_religion elven 33 and hidden_resource forest or hidden_resource grasland'
'recruit_pool "Lindon Militia Swordsmen" 1 12 1 0 requires factions { saxons, } and region_religion elven 33 and hidden_resource forest or hidden_resource grasland'
)
$S|% {
if ($_ -match $reg)
{
$Nb=$matches[3] -as [double]
Write-Debug "Found: $Nb"
$new=[string]::Format([System.Globalization.CultureInfo]::GetCultureInfo("en-US"), "{0}", ($nb*3))
"{0} {1} {2} {3}" -F $matches[1],$matches[2],$new,$matches[4]
}
else
{
Write-Debug "Not found : $_"
$_
}
} |
Partager