Useful REGEX for Hikashop ( regular expression )

  • Posts: 222
  • Thank you received: 26
  • Hikaserial Subscription Hikashop Business
6 years 1 day ago #290310

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

Last edit: 5 years 5 months ago by oxido. Reason: Youtube regex added
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum