Jump to content

Select string of text between quotes


Recommended Posts

Hello, 

I am interested in looking at a chunk of text, selecting the string that is in quotes, and copying it to the clipboard. It will always have quotes at the beginning and end, start with https:// and will always contain .mp3 . But everything else is pretty random. This is an example of a piece of text

Quote

 

suhfiushifuhrifuei file: "https://d1gwazgugjenv6.net/after/bef0re/062316.mp3?Expires=1470376621&Signature=h06vK9xR0mbXaMPKO0eQpBSUJX6hvK7l~AgQgCRMcd6DPJmbuMNOaD8P52pnvaGYrQUZUjBUlTfxXACtGyzgP-AdJZkcUlprGUtL47PAqLeiuu-JEomk2Y13qRB7eWjVVl3v0CfjXvgxQXVlwNob2HrmglVFKkusSJRdOTjuwAAZP89Pf~l3w2p6RFy9gL3E1nq3DQowa9NGIQYEdExLPDOYu5jLPI5lhuH8t8vTAZRCwq6YuJtIQ5vJgrQHkk4q7aECn8T8pGvwmossGjrcz-Ga0KlZiefBwFe7XXV66Xor5SVPkaoN3DTQ07ZuAqEtV5ccd6PyOM0iVLFfYjw__&Key-Pair-Id=APKAJ5GT74YAYAGA4KAA",   APKAJ5GT74YAYAGA4KAA


 

I tried doing something like this but it didn't like the quotes. 

$sStart = "file: ""
$sEnd = "","
$aExtract = _StringBetween($sStart, $sEnd)
ClipPut($aExtract)

 

Or is there a better/easier way to do this?

Link to comment
Share on other sites

Working with quotes in a string can get hairy fast and _StringBetween returns an array, try this code and see if it doesn't help...

#include <Array.au3>
#include <String.au3>
$string = 'suhfiushifuhrifuei file: "https://d1gwazgugjenv6.net/after/bef0re/062316.mp3?Expires=1470376621&Signature=h06vK9xR0mbXaMPKO0eQpBSUJX6hvK7l~AgQgCRMcd6DPJmbuMNOaD8P52pnvaGYrQUZUjBUlTfxXACtGyzgP-AdJZkcUlprGUtL47PAqLeiuu-JEomk2Y13qRB7eWjVVl3v0CfjXvgxQXVlwNob2HrmglVFKkusSJRdOTjuwAAZP89Pf~l3w2p6RFy9gL3E1nq3DQowa9NGIQYEdExLPDOYu5jLPI5lhuH8t8vTAZRCwq6YuJtIQ5vJgrQHkk4q7aECn8T8pGvwmossGjrcz-Ga0KlZiefBwFe7XXV66Xor5SVPkaoN3DTQ07ZuAqEtV5ccd6PyOM0iVLFfYjw__&Key-Pair-Id=APKAJ5GT74YAYAGA4KAA",   APKAJ5GT74YAYAGA4KAA'
$sStart = 'file: "'
$sEnd = '",'
$aExtract = _StringBetween($string, $sStart, $sEnd)
;ClipPut($aExtract)
_ArrayDisplay($aExtract)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...