Extract number between two strings
-
I am new to notepad++ and have no experience with regular expression so I could really use some help with extracting number between two strings.
Here is the data I currently have:
5573300cd8565aad0466cfc69f42350ac4b84|strs1A7FC70016849628742340.pdf|DocType=SAPdocument|sap_file_type=PDF|a_content_type=pdf|sap_object_type=VBRK|sap_object_id=1706090308 0312314578|sap_archive_id=XO|sap_doc_type=[ZSDOINVOIC]([link url]( link url))|system_id=S03| Here is how I would like that data to look (“after” data): 1706090308 0312314578 I would like to keep the numbers inclusive of the spaces between sap_object_id= and |sap_archive_id After some googling, I have tried using the following Find/Replace expressions and settings to no avail. Find What = (?<=object_id).+?(?=sap_archive) Replace With =$1 Search Mode = REGULAR EXPRESSION Is there even a possibility to achieve this? I would greatly appreciate your inputs.. Thank you. -
@Shahir-Afif said in Extract number between two strings:
Is there even a possibility to achieve this? I would greatly appreciate your inputs…
It certainly is possible, and you were on the right track.
Find What:(?-s).+?object_id=(.+?)sap_archive.+
Replace With:${1}Should work for you.
If you want more information on what it is doing ask.
Terry
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login