Image Handling Issue with Regex

We found the issue why Momentz frames/images aren’t showing up on the phone and it’s the way Regex handles links and embeds the images into text messages/twitter.

The Regex that looks at image links, the TLD is set to a maximum of 6 characters

/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g

Our TLD is .photography which is why our images dont show on the phone.

This regex should work?

/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,12}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g

The section changed is:

[a-z]{2,12} from [a-z]{2,6}

Please authenticate to join the conversation.

Upvoters
Status

Completed

Board

🐛 Bug Reports

Tags

Medium Priority

Date

Over 1 year ago

Author

pvramid

Subscribe to post

Get notified by email when there are changes.