Cut URLs into pieces

Hello, I’m looking for a way to trim an URL into multiple pieces.

  • Domain (without protocols)
  • Path
  • Parameters

Example: https://www.tagesanzeiger.ch/erhalten-mamis-und-papis-18-wochen-urlaub-680306995956?id="2345722r"

→ Should get:
tagesanzeiger.ch
erhalten-mamis-und-papis-18-wochen-urlaub
?id=“2345722r”

Maybe I’m looking at the wrong place, but how could I do that?

Regex is the friend to be googling for :slight_smile: eg
https://docs.airdev.co/functionality-reference/resources/regex

1 Like

You’ll need to add 3 text elements:

  1. Get data from current page URL → Find & Replace (https://) → split by (/) → item#1 (screenshot below :point_down:)
  2. Get data from current page URL → Path List → item#1
  3. Get data from current page URL → Parameter → Input parameter key(name) → Input parameter type

P.S.
Stop, I don’t need applause :clap: :joy:

3 Likes

@lindsay_knowcode Thank you for the hint! It seems like the ‘proper’ solution. Includes learning how to use Regex with Javascript.

@bestbubbledev How many hours did you search to get this?! That’s a fantastic workaround without Regex! Thanks a ton!!!

1 Like

It took me about 20 minutes to figure out how to get the domain :muscle: I knew how to do the rest :sunglasses:

To add another solution to your pile, I would really recommend @sudsy ’s Sudsy Page plugin. It does exactly this, plus gives you a lot of routing capabilities.

2 Likes