M HYPE SPLASH
// updates

Using Notepad++ I need a regular expression to find and replace

By Abigail Rogers

Today I learned about regular expressions. Today I also learned that I'm terrible at regular expressions!

I've been toying around with them and have an understanding of some features but what I actually need is vastly ahead of my current knowledge.

Working with thousands of lines like this I need to convert the following:

 "MeshURL": "", "DiffuseURL": "", "ColliderURL": "",

Into the following:

 "MeshURL": "file:///C:\Users\X\Documents\My Games\Tabletop Simulator\Mods\Models\httpcloud3steamusercontentcomugc1689401550837946539FEC7DBCEEDA29A385ADE5D797055307ADB992B03", "DiffuseURL": "file:///C:\Users\X\Documents\My Games\Tabletop Simulator\Mods\Images\httpcloud3steamusercontentcomugc1689401550837944885196661E00A9EF450B9F008C9126DE66B25E4AAA0", "ColliderURL": "file:///C:\Users\X\Documents\My Games\Tabletop Simulator\Mods\Models\httpcloud3steamusercontentcomugc1689401550837946539FEC7DBCEEDA29A385ADE5D797055307ADB992B03",

For easier parsing, the distinctions are:

  • Removing all symbols from the original URL so it's plain text.
  • Replacing "http://" with file:///address (address location dependant on first word in line)

I'm not sure how complex this is, but I theorize it may require tackling in multiple steps. Plus I may need to relocate all files into a single folder for simplicity. Any advise is appreciated although a copy-paste solution would make my day!

Thank you for your time.

Edit: So I'm able to search for URL's with http[^"]+ and I'm able to search for symbols with [^a-zA-Z0-9] but I can't figure out how to combine the search criteria.

Edit2: **Found assistance elsewhere and scripted the process. Thankyou for the suggestions. **

6

1 Answer

I'd think sed would do this in a jiffy. But you're unwilling to learn. I also think the biggest problem is the c:/ part of it, if you got rid of that then everything becomes zen.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy