Android Question Regex and reading section from html code

Discussion in 'Android Questions' started by kohle, Apr 16, 2015.

  1. kohle

    kohle Active Member Licensed User

    Hi,

    I didnt find it in the forum, so I ask :

    <span>bfbfbfb </span>

    In one line, I get it with the pattern : <span>(.*?)</span>

    When I have :

    <span>Test1
    Test2
    Test3
    </span>

    I dont get it. I know the dot is for reading until Linebreak.
    But how I can read over more lines in B4a

    rgs
    Jürgen
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Here:
    Code:
    Dim s As String = $"<span>Test1
    Test2
    Test3
    </span>"$

    Dim m As Matcher = Regex.Matcher("<span>(.*\n)*</span>", s)
    If m.Find Then
       
    Log(m.Match)
    End If
     
    Peter Simpson and DonManfred like this.
  3. kohle

    kohle Active Member Licensed User

    Thanks.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice