If cell A1 contains URL text:
http://my.URL.com/some/path/my-page.html
How can I write a formula in A2 which extracts the page title:
my-page
You may try =REGEXEXTRACT
with a regex featuring the following regex:
"^.*/(.*)\.[^.]+$"
It matches:
^
- start of string .*/
- matches the string up to the last /
(.*)
- matches and captures any 0+ chars up to the last .
\\.
- a dot [^.]+
- 1 or more chars other than a dot $
- asserts the position at the end of string. Note that once a capturing group is defined in the pattern, REGEXEXTRACT
returns the submatch captured.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.