Results 1 to 3 of 3

Thread: Non english regex

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2009
    Location
    Scotland
    Posts
    417

    Unhappy Non english regex

    Hi Guys,

    I'm working on a Russian site and I'm trying to use regex on these lines:

    Code:
    title="Дата создания: 29.09.2014">PROJECT NAME<img
    I'm trying to grab the project name in the html, the date changes from project to project so far I have:

    Code:
        Public Function returnProjects(ByVal html As String) As String
            Dim matchesSource As New Regex("title=""Дата создания: (.*?)"">(.*?)<img", RegexOptions.IgnoreCase)
            Dim releaseMatchFound As MatchCollection = matchesSource.Matches(html)
            For Each releaseMatch As Match In releaseMatchFound
                MessageBox.Show(releaseMatch.Groups(1).Value)
            Next
        End Function
    (I think that's right lol) but the Russian text seems to be the issue.

    Any pointers/help would be great guys, I'm stumped

    Graham

  2. #2
    Frenzied Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    1,335

    Re: Non english regex

    I'm thinking you want the third group
    Code:
    .Groups(2)
    if you're after finding "PROJECT NAME"

  3. #3
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,398

    Re: Non english regex

    Why would you group parts you dont even want to catch?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width