Extracing a specific text within a url

%3CLINGO-SUB%20id%3D%22lingo-sub-2351911%22%20slang%3D%22en-US%22%3EExtracing%20a%20specific%20text%20within%20a%20url%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2351911%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20an%20example%20url%20as%20follows%3A%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3E%26nbsp%3B%3C%2FP%3E%3CTABLE%20width%3D%221046%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%221046%22%3E%3CA%20href%3D%22http%3A%2F%2F1secretsofsuccess.com%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.****.com%2F***%2F*****%2Fa.346778818742590%2F3975284149225354%2F%3Ftype%3D3%26amp%3Bcomment_id%3D*******%26amp%3Breply_comment_id%3D*******%3C%2FA%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3EI%20want%20to%20be%20able%20to%20extract%20the%20second%20number%2C%203975284149225354%26nbsp%3B%2C%20from%20the%20link.%20Not%20every%20URL%20is%20the%20same%20however%20they%20all%20share%20the%20same%20pattern%20where%20there%20is%20a%20%22%2F%22%20then%20the%20first%20number%20and%20then%20another%20%22%2F%22%20then%20the%20second%20number.%20Is%20there%20a%20way%20to%20do%20this%20using%20text%20formula%20or%20will%20I%20have%20to%20use%20VBA%20regex%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20stars%20are%20there%20for%20confidentiality%20purposes.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2351911%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2352175%22%20slang%3D%22en-US%22%3ERe%3A%20Extracing%20a%20specific%20text%20within%20a%20url%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2352175%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1053151%22%20target%3D%22_blank%22%3E%40fcbda%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20say%20the%20URL%20is%20in%20A1.%20In%20another%20cell%20in%20row%201%2C%20enter%20the%20formula%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DTRIM(MID(SUBSTITUTE(A1%2C%22%2F%22%2CREPT(%22%20%22%2C255))%2C1400%2C255))%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20can%20be%20filled%20down%20if%20required.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2352213%22%20slang%3D%22en-US%22%3ERe%3A%20Extracing%20a%20specific%20text%20within%20a%20url%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2352213%22%20slang%3D%22en-US%22%3EPossible%20scammer.%20URL%20links%20to%20a%20different%20site.%3C%2FLINGO-BODY%3E
Occasional Contributor

I have an example url as follows:

 

https://www.****.com/***/*****/a.346778818742590/3975284149225354/?type=3&comment_id=*******&reply_c...

 

I want to be able to extract the second number, 3975284149225354 , from the link. Not every URL is the same however they all share the same pattern where there is a "/" then the first number and then another "/" then the second number. Is there a way to do this using text formula or will I have to use VBA regex?

 

The stars are there for confidentiality purposes.

 

Thanks

 

Thanks

4 Replies

@fcbda 

Let's say the URL is in A1. In another cell in row 1, enter the formula

 

=TRIM(MID(SUBSTITUTE(A1,"/",REPT(" ",255)),1400,255))

 

This can be filled down if required.

Possible scammer. URL links to a different site.

@Detlef Lewin not so, I found a generic site for confidentiality reasons. I assure you that I have no malicious intent.

@fcbda 

What is the exact logic?

- is it always after Nth slash (N is always the same)

- is it first number between slashes (a.346... is not a number)

- something else