Need a help to extract the exact integer number from a set of string. In the below example, I want to extract only 7614.
INFO: TB_SEC_FOLDER, 7614 folders
$a = 'INFO: TB_SEC_FOLDER, 7614 folders'
but it will give me output as 7614 folders, it will work if its only $a = 'INFO: TB_SEC_FOLDER, 7614'
$a -replace '^\D+(\d+).*$','$1'
The problem is that it replaces only the regex match, so you have to have the pattern match the whole string.
You must be logged in to reply to this topic.