Extract username from forward slash separated text <p>I need to extract a username from the log below via regex for a log collector. </p> <p>Due to the nature of the logs we're getting its not possible to define exactly how many forward slashes are going to be available and I need to select a specific piece of data, as there are multiple occurances of similar formatted data.</p> <p>Required data:</p> <pre><code>name="performedby" label="Performed By" value="blah.com/blah/blah blah/blah/**USERNAME**"| </code></pre> <p>&lt;46>Jun 23 10:38:49 10.51.200.76 25113 LOGbinder EX|3.1|success|2016-06-23T10:38:49.0000000-05:00|Add-MailboxPermission Exchange cmdlet issued|name="occurred" label="Occurred" value="6/23/2016 10:38:49 AM"|name="cmdlet" label="Cmdlet" value="Add-MailboxPermission"|name="performedby" label="Performed By" value="blah.com/blah/blah blah/blah/<strong>USERNAME</strong>"|name="succeeded" label="Succeeded" value="Yes"|name="error" label="Error" value="None"|name="originatingserver label="Originating Server" value="black"|name="objectmodified" label="Object Modified" value="blah/blah/USERNAME"|name="parameters" label="Parameters" value="Name: Identity, Value: [blah]Name: User, Value: [blah/blah]Name AccessRights, Value: [FullAccess]Name: InheritanceType, Value: [All]"|name="properties" label="Modified Properties" value="n/a"|name="additionalinfo" label="Additional Information"</p> <p>I've tried a few different regex commands but I'm not able to extract the necessary information without exactly stating how many / there will be.</p> <pre><code>blah\.com[.*\/](.*?)"\|name </code></pre>