powershell v4.0 - Extract substring delimited with a double quotes -


this powershell script: ((invoke-webrequest "http://www.gsmarena.com/battery-test.php3").allelements | class -eq "lalign").innerhtml

produced following output:

<a href="lenovo_p2-8319.php">lenovo p2</a> <a href="gionee_marathon_m5-7259.php">gionee marathon m5</a> <a href="xiaomi_mi_max_2-8582.php">xiaomi mi max 2</a> <a href="asus_zenfone_max_zc550kl-7476.php">asus zenfone max zc550kl</a> <a href="xiaomi_redmi_note_4-8531.php">xiaomi redmi note 4</a> <a href="samsung_galaxy_a7_(2017)-8335.php">samsung galaxy a7 (2017)</a> <a href="samsung_galaxy_s6_active-7114.php">samsung galaxy s6 active</a> <a href="xiaomi_mi_max-8057.php">xiaomi mi max</a> <a href="samsung_galaxy_j7_(2017)-8675.php">samsung galaxy j7 (2017)</a> <a href="xiaomi_redmi_3-7862.php">xiaomi redmi 3</a> <a href="nokia_lumia_1520-5760.php">nokia lumia 1520</a> <a href="huawei_ascend_mate2_4g-5949.php">huawei ascend mate2 4g</a> <a href="sony_xperia_z4_tablet_lte-7069.php">sony xperia z4 tablet lte</a> <a href="xiaomi_redmi_3_pro-8007.php">xiaomi redmi 3 pro</a> <a href="xiaomi_mi_5s_plus-8350.php">xiaomi mi 5s plus</a> <a href="xiaomi_redmi_3s-8150.php">xiaomi redmi 3s</a> <a href="samsung_galaxy_a9_(2016)-7641.php">samsung galaxy a9 (2016)</a> <a href="huawei_mate_8-7239.php">huawei mate 8</a> <a href="samsung_galaxy_j7_(2016)-7870.php">samsung galaxy j7 (2016)</a> <a href="sony_xperia_z3_compact-6538.php">sony xperia z3 compact</a> <a href="samsung_galaxy_tab_pro_10_1_lte-5941.php">samsung galaxy tab pro 10.1 lte</a> <a href="motorola_moto_z_play-8310.php">motorola moto z play</a> <a href="samsung_galaxy_c7-8046.php">samsung galaxy c7</a> <a href="meizu_m3_max-8321.php">meizu m3 max</a> <a href="samsung_galaxy_a8_duos-7506.php">samsung galaxy a8 duos</a> <a href="meizu_m5_note-8450.php">meizu m5 note</a> <a href="samsung_galaxy_a8-7249.php">samsung galaxy a8</a> <a href="lg_g_flex-5806.php">lg g flex</a> 

but need strings between double quotes. how can it?

for case specifically, should work: put whole string in variable $string , execute below line

$string.split('"')|%{if($psitem.tostring().endswith('.php')){write-host $psitem}} 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -