I needed to use regex on my site on a custom text field and I think it's good that this regex created by me will not be lost, so I decided to post it here, and maybe other people will post they regex code they used and how.
So, in Hikashop i went to: Hikashop > Display > Custom Fields
I created a new field type: Text
And under the MAIN ATARIBUTES section you will have Regular expression check field, i use this next regex to only accept in my field URL from soundcloud.com only.
In this format: https:// or http:// (with or without www), soundcloud.com / user / song
REGEX:
(https?://)(www.)?soundcloud\.com/[\w\-\.]+(/)+[\w\-\.]+/?
Like this one:
https://soundcloud.com/0xid0/summer-nights/
I hope it will be useful!
Youtube(https?://)(www.)?youtube\.com/?.+
1) It will accept this format:
http or https
2) With or without www
3)
.com only