x Did you like it? Well, then please consider making a donation :)

Category - E-Mail, Url

Simple example - non capturing group

If I apply the regex below over it: (http|ftp)://([^/\r\n]+)(/[^\r\n]*)? I would get the following result: Match "http://stackoverflow.com/" Group 1: "http" Group 2: "stackoverflow.com" Group 3: "/" But I don't care about the protocol - I just want the host and path of the URL. So, I change the regex to include the non-capturing group (?:): (?:http|ftp)://([^/\r\n]+)(/[^\r\n]*)? Now, my result looks like this: Match "http://stackoverflow.com/" Group 1: "stackoverflow.com" Group 2: "/"

Type: match, Date: 7/12/2015 3:23:20 PMAuthor: stackoverflow

Splitting Link using RegEx

i want to find category from the link. I am breaking the link into array using Regex.

Type: split, Date: 3/31/2015 5:40:43 PMAuthor: admin