Let me know if anyone agrees and thanks for viewing!
by poshoholic at 2012-08-29 11:12:18
Sure, that works. You can simplify it a little if you like, to this:
$_ -replace '\([^\)]+\)'
All I changed in the regex was to remove the capturing brackets since you don't need to capture anything. Also, by leaving off the empty string PowerShell knows you're simply removing any matches (replacing them with nothing). Your solution is just fine as is though.
by suave9987 at 2012-08-29 11:56:44
Great! Ok thank you.
I am always looking to simplify my code and it is great to have feedback from a MVP.
The topic ‘Simple Remove things between Parenthesis- REGEX’ is closed to new replies.