Regex for the URL

advertisements

Can someone help me with writing the regex for the below URL? I want a Regex to match the whole URL. The url format will be like this.

https://www.mywebsite.com/us/cgi-bin/binary?cmd=_payment-option&transaction_id=8768JKHKJG19322&account_number=6UN85941RH525783L&transaction_date=Apr 12, 2012&transaction_amount=-$11.00&ccode=USD&act_id=6K6218756F7819322&counterparty=Pretty Flower Florist&initiated_page=_login&go_Ah9w8keNJ8YRLMkAMTS_Izeq0br1CF6OVtGv69WzOo8AjgDgGIiBetMG-lK&Go_Actions

This is what I have got so far, but it is matching only till the first '&'

http[s]*:\/\/www.[a-zA-Z0-9.]*mywebsite.[a-zA-Z]*[/]*[a-zA-Z0-9]*[/]*cgi-bin[/]*binary[?]*cmd=[_a-z\-]*[[\&][a-zA-Z0-9_-]*[=][a-z ,A-Z0-9_-]*]*

How can I repeat the pattern &transaction_id=8768JKHKJG19322?

[[\&][a-zA-Z0-9_-]*[=][a-z ,A-Z0-9_-]*]* does not seem to work


This is not very robust regex, but it should give you the idea - repeat common patterns.

http[s]?:\/\/www\.mywebsite\.com(?:\/[a-zA-Z-?=_&\d\s,$\.]+)+