# How can I strip the text in front of the https for this url?

**URL:** <https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757>\
**Category:** Ask for Help\
**Created:** [November 19, 2021, 5:23am UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757 "2021-11-19T05:23:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Malcolm\_Lewis](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Malcolm\_Lewis](https://community.glideapps.com/u/Malcolm_Lewis)\
**Post date:** [November 19, 2021, 5:23am UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/1 "2021-11-19T05:23:13Z")

</div>

Note this url:

`The Orphan Collector: A Heroic Novel of Survival During the 1918 Influenza Pandemic https://www.amazon.com/dp/1496715861/ref=cm_sw_r_cp_api_glt_fabc_YXJ2TJYZ14F5T705NC3T`

For some reason, Amazon adds descriptive text before the URL when I copy/post from their website on my phone. I need to strip out everything before the https. What’s the best way to do that in Glide?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 19, 2021, 5:33am UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/2 "2021-11-19T05:33:54Z")

</div>

I would probably create a split column to split on ‘://’. Then create a single value column to get the second array item from the split array. The create a template column to join ‘https://’ and the single value, which should be the rest of the url. This should work if there is or isn’t extra text concatenated to the beginning of the link.

---

<div class="post-metadata">

**Author:** ![Malcolm\_Lewis](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Malcolm\_Lewis](https://community.glideapps.com/u/Malcolm_Lewis)\
**Post date:** [November 19, 2021, 5:48am UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/3 "2021-11-19T05:48:14Z")

</div>

Thanks, Jeff

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 19, 2021, 6:21am UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/4 "2021-11-19T06:21:30Z")

</div>

Another option could be the [Extract Matching Text](https://www.glideapps.com/plugins/regex) plugin…

 ![Screen Shot 2021-11-19 at 2.19.48 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/8/9844b1e5a1f1e5a1d514fbc141b905adb8a21862.png)

One thing to note is that both solutions would fail if you had extra text after the URL. Should be possible to craft a regex to deal with that, but my regex-fu is a bit rusty.

Update: `(https:[^\s]+)` seems to work when there is trailing text. It just stops capturing when it hits the first whitespace character.

 ![Screen Shot 2021-11-19 at 2.51.45 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b614f86c4b148062ecf781d6b0fff6e609c42b3d.png)

Of course, writing regex to match URL’s is a bit of a slippery slope… 😃

---

<div class="post-metadata">

**Author:** ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)\
**Post date:** [November 19, 2021, 3:50pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/5 "2021-11-19T15:50:31Z")

</div>

You could also use a Code/Javascript column with this code:

```auto
return p1.substr(p1.toUpperCase().indexOf("HTTP"));

```

---

<div class="post-metadata">

**Author:** ![Malcolm\_Lewis](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Malcolm\_Lewis](https://community.glideapps.com/u/Malcolm_Lewis)\
**Post date:** [November 19, 2021, 5:25pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/6 "2021-11-19T17:25:30Z")

</div>

> [@George-Glide](#):
>
> `return p1.substr(p1.toUpperCase().indexOf("HTTP"));`

Thanks. See below. Where does the JS go?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3fc25db41979d6b78e10c89a6156104120bde0ff.png)

---

<div class="post-metadata">

**Author:** ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)\
**Post date:** [November 19, 2021, 8:16pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/7 "2021-11-19T20:16:30Z")

</div>

This is what mine looks like. I don’t know why to Function Error shows up but it works anyway.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/a/4a4b392f53cd64d1a09163a3898c8e4e16873423.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 19, 2021, 9:13pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/8 "2021-11-19T21:13:06Z")

</div>

I’d guess the error would be triggered by rows where the column being referenced is empty.

---

<div class="post-metadata">

**Author:** ![George-Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george-glide/32/22384_2.png) [@George-Glide](https://community.glideapps.com/u/George-Glide)\
**Post date:** [November 20, 2021, 1:18pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/9 "2021-11-20T13:18:37Z")

</div>

I added a type check but interestingly this code gives the error initially but if you tap the Reload then it goes away.

```auto
return (typeof p1 === "string" ? 
 p1.substr(p1.toUpperCase().indexOf("HTTP")) : "")
```

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [November 20, 2021, 1:23pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/10 "2021-11-20T13:23:44Z")

</div>

That’s right, the error goes away once you reload. It does that with all return functions. But all work.

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [November 20, 2021, 1:45pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/11 "2021-11-20T13:45:47Z")

</div>

Hola Wiz and George,

The function error is caused by some empty row in your **Test column** , this happens using any plugin or EC.

The plugin runs fine when it finds all valid values (rows) belonging to column set as parameter. I think it is not an error at all, looks like a warning ⚠

Bye

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [November 20, 2021, 1:59pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/12 "2021-11-20T13:59:54Z")

</div>

Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [November 20, 2021, 2:13pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/13 "2021-11-20T14:13:36Z")

</div>

> [@Malcolm\_Lewis](#):
>
> The Orphan Collector: A Heroic Novel of Survival During the 1918 Influenza Pandemic [https://www.amazon.com/dp/1496715861/ref=cm\_sw\_r\_cp\_api\_glt\_fabc\_YXJ2TJYZ14F5T705NC3T](https://www.amazon.com/dp/1496715861/ref=cm_sw_r_cp_api_glt_fabc_YXJ2TJYZ14F5T705NC3T)

If you want to extract just the url without having to worry about leading and trailing texts or don’t want to use JavaScript, then use this Regex

((http|https)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(/\S\*)?)

Steps:

1. Add the extract matching text plugin
2. For text, select your amazon column
3. In the regular expression field copy paste the above regex

Note

In Glide expressions from what I have discovered so far need to be wrapped inside () for them to yield true results.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 20, 2021, 2:41pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/14 "2021-11-20T14:41:56Z")

</div>

> [@Wiz.Wazeer](#):
>
> If you want to extract just the url without having to worry about leading and trailing texts or don’t want to use JavaScript, then use this Regex
> 
> ((http|https)://[a-zA-Z0-9-.]+.[a-zA-Z]{2,3}(/\S\*)?)

erm…

> [@Darren\_Murphy](#):
>
> Update: `(https:[^\s]+)` seems to work when there is trailing text. It just stops capturing when it hits the first whitespace character.

😛

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 20, 2021, 3:38pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/15 "2021-11-20T15:38:08Z")

</div>

> [@Wiz.Wazeer](#):
>
> need to be wrapped inside ()

I’ve noticed this too

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 20, 2021, 3:41pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/16 "2021-11-20T15:41:05Z")

</div>

In regex speak, they are referred to as “capturing parentheses” 😉

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [November 20, 2021, 3:43pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/17 "2021-11-20T15:43:09Z")

</div>

Love that you know this. This is why you’re such an asset in this community!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [November 20, 2021, 3:57pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/18 "2021-11-20T15:57:07Z")

</div>

I had a mis-spent youth as a [Perl hacker](https://opensource.com/article/18/7/confessions-recovering-perl-hacker), so regular expressions are not entirely a new concept 😉

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [November 20, 2021, 5:51pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/19 "2021-11-20T17:51:48Z")

</div>

Sorry missed it 😌

---

<div class="post-metadata">

**Author:** ![Wiz.Wazeer](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wiz.wazeer/32/72423_2.png) [@Wiz.Wazeer](https://community.glideapps.com/u/Wiz.Wazeer)\
**Post date:** [November 20, 2021, 6:24pm UTC](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757/20 "2021-11-20T18:24:11Z")

</div>

The only problem with your regex is that it will not catch http.  
The one I suggested would catch both http/s

[Next page](https://community.glideapps.com/t/how-can-i-strip-the-text-in-front-of-the-https-for-this-url/34757.md?page=2)
