File tree Expand file tree Collapse file tree
Assets/Hypertext/Examples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ public class RegexExample : MonoBehaviour
55 [ SerializeField ]
66 RegexHypertext _text ;
77
8- const string _urlPattern = "http(s)?://([\\ w-]+\\ .)+[\\ w-]+(/[\\ w- ./?%&=]*)?" ;
9- const string _hashtagPattern = "[##][A-Za-zA-Za-z一-鿆0-90-9ぁ-ヶヲ-゚ー]+" ;
8+ const string RegexURL = "http(s)?://([\\ w-]+\\ .)+[\\ w-]+(/[\\ w- ./?%&=]*)?" ;
9+ const string RegexHashtag = "[##][A-Za-zA-Za-z一-鿆0-90-9ぁ-ヶヲ-゚ー]+" ;
1010
1111 void Start ( )
1212 {
13- _text . SetClickableByRegex ( _urlPattern , Color . cyan , url => Debug . Log ( url ) ) ;
14- _text . SetClickableByRegex ( _hashtagPattern , Color . green , hashtag => Debug . Log ( hashtag ) ) ;
13+ _text . SetClickableByRegex ( RegexURL , Color . cyan , url => Debug . Log ( url ) ) ;
14+ _text . SetClickableByRegex ( RegexHashtag , Color . green , hashtag => Debug . Log ( hashtag ) ) ;
1515 }
1616}
You can’t perform that action at this time.
0 commit comments