@@ -132,6 +132,8 @@ public class MyLinkify {
Linkify.addLinks(body, Patterns.XMPP_PATTERN, "xmpp", XMPPURI_MATCH_FILTER, null);
Linkify.addLinks(body, Patterns.TEL_URI, "tel");
Linkify.addLinks(body, Patterns.SMS_URI, "sms");
+ Linkify.addLinks(body, Patterns.BITCOIN_URI, "bitcoin");
+ Linkify.addLinks(body, Patterns.BITCOINCASH_URI, "bitcoincash");
Linkify.addLinks(body, Patterns.AUTOLINK_WEB_URL, "http", WEBURL_MATCH_FILTER, WEBURL_TRANSFORM_FILTER);
if (includeGeo) {
Linkify.addLinks(body, GeoHelper.GEO_URI, "geo");
@@ -33,6 +33,18 @@ public class Patterns {
+ "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ "|(?:\\%[a-fA-F0-9]{2}))+");
+ public static final Pattern BITCOIN_URI = Pattern
+ .compile("bitcoin\\:(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|[bB][cC]1[pPqQ][a-zA-Z0-9]{38,58})(?:\\?(?:(?:["
+ + Patterns.GOOD_IRI_CHAR
+ + "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ + "|(?:\\%[a-fA-F0-9]{2}))+)?");
+
+ public static final Pattern BITCOINCASH_URI = Pattern
+ .compile("bitcoincash\\:(?:[13][a-km-zA-HJ-NP-Z1-9]{33}|[qp][a-z0-9]{41})(?:\\?(?:(?:["
+ + Patterns.GOOD_IRI_CHAR
+ + "\\;\\/\\?\\@\\&\\=\\#\\~\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])"
+ + "|(?:\\%[a-fA-F0-9]{2}))+)?");
+
/**
* Regular expression to match all IANA top-level domains.
* List accurate as of 2011/07/18. List taken from: