1

I am trying to extract data from a URL that is in a single cell in google sheets. The data in the cell is:

https://www.aliexpress.com/item/2017-SKMEI-Outdoor-Sports-Compass-Watches-Hiking-Men-Watch-Digital-LED-Electronic-Watch-Man-Sports-Watches/32790079639.html?spm=a2g01.8286187.3.1.3fa025c4ONMmXB&scm=1007.14594.99248.0&scm_id=1007.14594.99248.0&scm-url=1007.14594.99248.0&pvid=bff55205-e331-4c05-9e04-6e8c1a660f0f

From the URL I need to extract the number: 32790079639

Is there a way collecting this information?

Thanks!

2 Answers 2

1

You can use the function =REGEXEXTRACT to achieve this goal. This function uses a regular expression to extract a substring from the input. For example,

=REGEXEXTRACT(A1, "([0-9]+)\.html")

A full example here

Sign up to request clarification or add additional context in comments.

Comments

1

=REGEXEXTRACT(A1,"([^/]*)\.html")

A1 is text with your URL.

  • [^/]* -- any text, not /,
  • (...) -- to capture gruop

1 Comment

You'll want to escape the . in your expression; By default, . matches any character that's not newline

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.