Search for number in URL

Hi, I have a macro that gets copies a URL to the clipboard. I'd then like to extract a number from the URL and feel like the solutiuon is regex but I have no idea what I'm doing.

Here's my workflow so far:

Command + L puts the cursor in the URL box and Command + C copies it. Now I'd like to find a number.

Here's an example URL:
https://example.com/wp-admin/post.php?post=196475&action=edit&classic-editor and I'd like to extract the number 196475

Thanks in advance for any help.

12

If the format of the URL is always exactly like that, so that you have:
post=<IntegerNumber>

then you can use this RegEx:
(?i)post=(\d+)

For details, see https://regex101.com/r/0uSmdo/1/

Use this RegEx in a KM Search using Regular Expression action

You can test any RegEx using Regex101.com

Let us know if you need further help.

That worked perfectly, thanks a lot.