wzc0014

Select string of text between quotes

2 posts in this topic

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?

Share this post


Link to post
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)

 

Share this post


Link to post
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

  • Similar Content

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Guys this is my gui and i need the numeric value typed in the highlighted  inputbox. if this value is greater than 1 i need to perform some operations
      \
       
      Here is the summary about that field which i got from wininfo tool

      i tried writing the code as shown below.. but the msgbox is popping up empty value..when the same code is pasted under some button action i am able to access the value present in the field..but when placed alone as written in the attached script i am unable to fetch it... 

      here i am using the valu present in the field

      can you guys tell me what's wrong??? or how can i get that value?
       
      My_GUI.au3

    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      in need the path/text present int above shown input box to be copied or retrieved into a variable .. how can i do that?
       
      Thanks
       
    • Shirdish_chakravarthi
      By Shirdish_chakravarthi
      Hello Friends i am new to autoit and i am stuck in middle of automation of flashing tool..
      my requirement is i have a window and i have to get the value present in that window (below is the picture)

      in the above window i need to get the value of the highlighted field.the value of this filed keeps on changing...ii need to get the current value present in the field..below are the details of the window and field..

       
      CAN it be done?
       
      thanks

    • hcI
      By hcI
      Hello
      Today I'm working on listbox but there might be something that I'm missing...
      I made a little script that allow the user to swap 2 items for the listbox. So the user select for example the 3rd item, press the button "Up" and it switch with the 2nd one, same with the "Down" button that switch with the 4th one.
      But when I select the 3rd item and switch it the item become unselected and I would like to select it again after the manipulation :
      As you can see in the comment of the script, _GUICtrlListBox_SetSel don't highlight/select them once the swap process is done..
      What am I missing ?
    • houser747
      By houser747
      I have previously used _IEFormElementGetObjByName and _IEFormElementSetValue to enter text into a search box on a form and then submit the form.
      I am now trying to enter text into a search box which is not part of a form. 
      Here is the HTML from the website that i'm trying to enter the data on and then submit the search.
      <div class="row">
          <div class="form-group col-xs-12">
              <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_lblSearchText" for="input-search">Registreringsbeteckning</span>
              <div class="input-group col-xs-12">
                  <span id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_preSearchText" class="input-group-addon">SE -</span>
                  <input name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$txtSearchText" type="text" value="DTH" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_txtSearchText" class="form-control" />
              </div>
          </div>
      </div>
      <div class="row">
          <div class="form-group col-xs-12">
              <label class="sr-only" for="">Sök</label>
              <input type="submit" name="ctl00$FullWidthWithSubmenuContent$FullWidthContent$MainContent$AircraftRegistry$btnSearch" value="Sök" id="FullWidthWithSubmenuContent_FullWidthContent_MainContent_AircraftRegistry_btnSearch" class="btn btn-primary ladda-button" data-style="expand-right" />
          </div>
      </div>
      Many thanks in advance
      cheers
      Roger