Hello guys,I need to validate the video URL when we add the URL in the form I need to use regex for it how can I validate (ex:- YouTube URL, SharePoint URL, etc ..)
Someone can help?
Thanks
Hi Deepak,
Check out these links
https://success.outsystems.com/documentation/how_to_guides/logic/how_to_use_regular_expressions_in_outsystems/
https://regexr.com/3dj5t
Hope that it helps you
Hi @Deepak Tandle
here is regex for Youtube URL
Regex:-
"^((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube(-nocookie)?\.com|youtu.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?$"
its work fine for me.
Hello @aanchal sharma Thank you for the response, I have checked this, and it is working fine but I need to check SharePoint video URL. Do you have any suggestions for it? Thanks
Hello
I guess the best way for you is to write your custom pattern and check each result case here:https://regexr.com/What else you can do is search for patterns on forums there are 100 of results you will find with pre-written patterns and make changes based on your requirements.
Once the test cases are passed apply the same to your Outsystems,We have actions available for it, you can refer to a link shared by @Alexandre Yip if you want to do it on a client-side only you can use JS or you can use a forge component JavaScriptUtils.
ThanksTousif Khan
Hello Tousif Khan
Thank you for the response. I will try it.