what is correct code for extract line id url ?

Discussion in 'JavaScript' started by helpmee, Sep 18, 2018.

  1. #2
    i copy javascript code from internet for test extract url from any source code.
    this is some code for extract url ( it can extract line id url too)

    if (address_type == "web") {
    rawemail = input.match(/([A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_%&\?\~/.=]+)/gi);
    } else {

    when source code was extracted it will show result in this:

    example

    line.me/ti/p/~bond007
    line.me/ti/p/~aaa.bbb207/12

    BUT word /12 not line id i confirm i don't want it.

    what is correct Regular Expressions for extract line id url to this format ?
    https://line.me/ti/p/~aaa.bbb207
     
    Last edited by a moderator: Sep 19, 2018
    helpmee, Sep 18, 2018 IP
  2. mmerlinn

    mmerlinn Prominent Member

    Messages:
    3,197
    Likes Received:
    819
    Best Answers:
    7
    Trophy Points:
    320
    #3
    Where is your post? Without more information it is impossible to give you a decent answer.
     
    mmerlinn, Sep 18, 2018 IP
  3. helpmee

    helpmee Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    i can not edit topic i am very surprise

    what is correct javascript code for extract line id url ?

    i copy javascript code from internet for test extract url from any source code. this is some code for extract url ( it can extract line id url too)

    if (address_type == "web") { rawemail = input.match(/([A-Za-z]+://[A-Za-z0-9-]+.[A-Za-z0-9-%&?~/.=]+)/gi);} else {

    when source code was extracted it will show result in this:

    example see at https://imgur.com/vFf7R4t

    BUT word /12 not line id i confirm i don't want it.

    what is correct Regular Expressions for extract line id url to this format > https://line.me/ti/p/~aaa.bbb207
     
    Last edited: Sep 19, 2018
    helpmee, Sep 18, 2018 IP