How can I write a regular expression to match URLs that contain emojis? The regex should match ordinary alphanumeric URLs along with URLs containing emojis in the domain name, path and/or parameters such as:
http://
How can I write a regular expression to match URLs that contain emojis? The regex should match ordinary alphanumeric URLs along with URLs containing emojis in the domain name, path and/or parameters such as:
http://
Regex to check URL contains Alphabets
Regex to check URL contains Numbers
Regex to check URL contains special characters
Regex to check URL contains alphanumeric and emojis
Adjust size and change the special characters as per your need.
This regular expression matches ordinary alphanumeric URLs along with URLs containing emojis in the domain name, path and/or parameters:
Try it out here: https://regexr.com/3gsl9
Notice that the range of unicode characters that include emojis (i.e. \uXXXX-\uXXXX) might need to be updated in future when new emojis will be added.
http://\S+
Where \S+ captures all non whitespace
The trick is keeping the regex from being too greedy, you may need some additional info to help determine the end of the url, is it whitespace or encapsulated in some way?