Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

powershell regex alot of similar words, how to short result

$
0
0

Hi,

So i was thinking of pulling powershell forums and selecting only topics thats have 0 replies, the problem is the words are repeating and its grabbing a bigger range of different posts then whats wanted.. so as an example say the text is (text was reformated from html and has no returns or newlines)

"0 Votes Last resort - using a gui to keep my powershell session alive Windows Server Forums Windows PowerShell Windows PowerShell Discussion on Windows Server Windows Powershell Announcements : 2 Hello All, I've been trying to take this code which watches a service through wmi event - and then restarts it if it gets shut down - and create a service out of ... 5 Replies | 64 Views | Last Post 3 hours 6 minutes ago Proposed 7 Votes Need Powershell Script to get shared folder and NTFS permission from list of servers Windows Server Forums Windows PowerShell Windows PowerShell Discussion on Windows Server Windows Powershell Announcements : 2 Hi Friends, I need powershell script to dump all the shared folder and thier permission from serverlist.txt. the below code just giving me the shares but ... 14 Replies | 11597 Views | Last Post 4 hours 18 minutes ago Unanswered 0 Votes Powershell command execution differences Windows Server Forums Windows PowerShell Windows PowerShell Discussion on Windows Server Windows Powershell Announcements : 2 Hi all, i have a question regarding invoking external programs in a powershell script. Recently i had to deal with removing java. So i have written a small script ... 0 Replies | 32 Views | Last Post 4 hours 19 minutes ago Unanswered 0 Votes Sql Server connectivity and script execution using Powershell Windows Server Forums Windows PowerShell Windows PowerShell Discussion on Windows Server Windows Powershell Announcements : 2 Iam designing a powershell script that can execute some sql scripts that is placed inside a folder. Actually this must be done remotely. I am able to connect to the particular server remotely ... 0 Replies"

The regex i am using is something like this Votes\s(.+)\sForums[\d\Wa-zA-Z]+0\sReplies, and my problem is i am going from word votes to 0 replies which occuring more than once and i am not sure how to tell it to stop at the first match.

Anyone knows how i could seperate each votes to 0 replies keywords instead getting the whole string?

thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>