RE: [powershell] Remove anything between defined characters:

2016-11-30 Thread Michael B. Smith
, November 30, 2016 4:31 PM To: powershell@lists.myitforum.com Subject: RE: [powershell] Remove anything between defined characters: Which is much better than my way, but here it is anyway ☺ since it takes a different approach. $a = "Jessica (Yvonne)" $b = "" for ($i = 0; $i -lt $

RE: [powershell] Remove anything between defined characters:

2016-11-30 Thread Orlebeck, Geoffrey
@lists.myitforum.com Subject: Re: [powershell] Remove anything between defined characters: No problem. :) I am doing 3 things with this regex. I am looking for a single set of parenthesis \(.*?\) that is preceded or followed by a space ?. Since the space character is not necessarily there, I use the

RE: [powershell] Remove anything between defined characters:

2016-11-30 Thread Orlebeck, Geoffrey
...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Scott Crawford Sent: Wednesday, November 30, 2016 1:31 PM To: powershell@lists.myitforum.com Subject: RE: [powershell] Remove anything between defined characters: ATTENTION: This email came from an external source. DO NOT open

RE: [powershell] Remove anything between defined characters:

2016-11-30 Thread Scott Crawford
if (-not $Delete -eq $true -and $a[$i] -ne ")") {$b = $b + $a[$i]} } $b.TrimEnd() From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On Behalf Of Devin Rich Sent: Wednesday, November 30, 2016 3:15 PM To: powershell@lists.myitforum.com Subject: Re: [powershe

Re: [powershell] Remove anything between defined characters:

2016-11-30 Thread Devin Rich
itial space is required in the beginning “ ?\(.*?\) > ?" > > > > Thanks, > > Geoff > > > > *From:* listsad...@lists.myitforum.com [mailto:listsadmin@lists. > myitforum.com] *On Behalf Of *Devin Rich > *Sent:* Wednesday, November 30, 2016 1:15 PM > *To:* powershell@lists

RE: [powershell] Remove anything between defined characters:

2016-11-30 Thread Orlebeck, Geoffrey
emove anything between defined characters: ATTENTION: This email came from an external source. DO NOT open attachments or click on links from unknown senders or unexpected emails. I would do it this way because i'm lazy: -replace " ?\(.*?\) ?" PS > "(ywfew) Jessica (Yvs)&quo

Re: [powershell] Remove anything between defined characters:

2016-11-30 Thread Devin Rich
I would do it this way because i'm lazy: -replace " ?\(.*?\) ?" PS > "(ywfew) Jessica (Yvs)" -replace " ?\(.*?\) ?" Jessica PS > "(ywfew)Jessica (Yvs)" -replace " ?\(.*?\) ?" Jessica PS > "Jessica (Yvs)" -replace " ?\(.*?\) ?" Jessica Thanks, Devin Rich Systems Administrator On Wed, Nov 30, 2

[powershell] Remove anything between defined characters:

2016-11-30 Thread Orlebeck, Geoffrey
I'm working on a script that gets some data fed into it. Some of the fields have two names, one wrapped in (). Example: "Jessica (Yvonne)". I am trying to remove everything within the (), but I'm not sure how. I've tried several regex expressions, and I'm able to remove the (), but not the conte