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

Splitting Link using RegEx

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

Tags: #link, #splitting, #web. Views: 5716. admin, 3/31/2015
Link 1: http://www.systemtextregularexpressions.com/s6/splitting-link-using-regex
Link 2: http://www.systemtextregularexpressions.com/s6 (short)

Length: 0b, Line: 1, Cursor: 0

RegexOptions

IsMatch=true


#Value
0http:
1www.example.com
2lifestyle
3food
4a93ypt9-1227277841603
5from=public_atom
Count: 6, Time: 00:00:00

Share (without adding to database):

Source code

0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
//.NET Regex.Split Online Tester: www.systemtextregularexpressions.com

//Namespace
using System.Text.RegularExpressions;

//Regex Pattern
string pattern = @"\/{1,2}|\?{1}";

//Regex example #1
Regex r = new Regex(@"\/{1,2}|\?{1}");
string[] result1 = r.Split("input text");

//Regex example #2
string[] result2 = Regex.Split("input text", @"\/{1,2}|\?{1}");
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
'.NET Regex.Split Online Tester: www.systemtextregularexpressions.com

'Namespace
Imports System.Text.RegularExpressions

'Regex Pattern
Dim pattern As String = "\/{1,2}|\?{1}"

'Regex example #1
Dim r As Regex = New Regex("\/{1,2}|\?{1}")
Dim result1() As String = r.Split("input text")

'Regex example #2
Dim result2() As String = Regex.Split("input text", "\/{1,2}|\?{1}")

Home     Match     Replace     Split     Help     Library     Contacts     netregex rss

Made by Koshevoy Dmitry [8Bytes],

© 2014-2024 Ukraine, Nikolaev.