Hack Forums
[.NET] [Help] with using regex on a website - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Help] with using regex on a website (/showthread.php?tid=5689637)



[Help] with using regex on a website - Louis - Aug 8, 2017

I've been trying to make a regex for the steam market, using these resources but it just Isn't working.

youtube.com/ watch?v=FpAvBOhDrYk
youtube.com /watch?v=SUmSwV2lZ9U
stackoverflow c om/ questions/22728673/vb-net-scraping-from-a-website


* - +Haze - Aug 8, 2017

It's often better to just use a HTML parser like AngleSharp. It works out to be a lot better for parsing as it's easy to read, maintain and write.


* - Ninja - Aug 8, 2017

(Aug 8, 2017 12:01 PM)+Haze Wrote:  It's often better to just use a HTML parser like AngleSharp. It works out to be a lot better for parsing as it's easy to read, maintain and write.

Nah the grasshopper algorithm is far superior.


* - SIM-3327349 - Aug 8, 2017

You can try use functions like this:
Code
Public Function GetBetween(ByVal haystack As String, ByVal needle As String, ByVal needle_two As String) As String
        Dim istart As Integer = InStr(haystack, needle)
        If istart > 0 Then
            Dim istop As Integer = InStr(istart, haystack, needle_two)
            If istop > 0 Then
                Try
                    Dim value As String = haystack.Substring(istart + Len(needle) - 1, istop - istart - Len(needle))
                    Return value
                Catch ex As Exception
                    Return ""
                End Try
            End If
        End If
        Return ""
    End Function