Relative Content

Tag Archive for pythonregexpython-re

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 14 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 14 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 7 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 7 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 7 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

Is there a way to match a string that is preceded by the last instance of another string? [duplicate]

This question already has answers here: Regex finding shortest string with starting word and ending word (1 answer) Retrieving parameters from a URL (21 answers) Closed 7 hours ago. Suppose I have a string like follows: address = ‘https://tenant.sharepoint.com/sites/site1/Shared%20Documents/Forms/AllItems.aspx?id=%2Fsites%2Fsite1%2FShared%20Documents%2F2023%20Q1%20AMZN.pdf&parent=%2Fsites%2Fsite1%2FShared%20Documents’ I would like to extract the file name ‘2023%20Q1%20AMZN.pdf’ from this address (for simplicity, we can […]

How to grab number after word in python

I have a huge file containing the following lines DDD-1126N|refseq:NP_285726|uniprotkb:P00112 and DDD-1081N|uniprotkb:P12121, I want to grab the number after uniprotkb.

regex for text extraction in python

I’m trying to extract whatever is between ‘[…]’ and ‘- Aufgabe …’ in the below strings. Either or both of ‘[…]’ and ‘- Aufgabe …’ are optional and may not sometimes exist.