如何使用正则表达式和Powershell从字符串“Task(12345)”中提取数字?我尝试了以下方法,但没有成功。
$file = gc myfile.txt
$matches = ([regex]"Task\(\d{1,5}\)").matches($file)
# Get a list of numbers
请问有人能帮我找到正确的正则表达式吗?