1

I have surfed the internet for solutions but nothing, my question is simple, what regex pattern do I need to validate an android and ios deep link for validation.

MOBILE DEEP LINK DEFINITION : Mobile deep linking. In the context of mobile apps, deep linking consists of using a uniform resource identifier (URI) that links to a specific location within a mobile app rather than simply launching the app. Deferred Deep Linking allows users to deep link to content even if the app is not already installed.

Mobile deep link could come in different forms eg

hi://mob.com hello://w.l.o

how will it be validated:

NB : I have not seen any solution online to this, try your google search and youtube search.

5
  • 1
    What are android and ios deep links? Please provide examples and what you've tried so far. Commented Jul 11, 2018 at 1:25
  • @user3783243 I have edited my question. Commented Jul 11, 2018 at 1:37
  • u should gv an example of what deeplink url u want to validate Commented Jul 11, 2018 at 1:44
  • @hatched given more explanation, not seen any solution online. Commented Jul 11, 2018 at 1:49
  • Maybe ^[a-z]{2,}://[a-z0-9.]+$ not really clear what the rules are still for a valid/invalid deep link. Commented Jul 11, 2018 at 2:44

1 Answer 1

0

Firstly, they are 80% secured that is if you are building an app linking, but for validation it is 95% fair.

Try

$deeplinkURI = example://fb.com/cool 
if (preg_match("/(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))/", $deeplinkURI )){

 } else {
  echo "Invalid Deep link URI";
  exit();
 } 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.