Skip to content

Instantly share code, notes, and snippets.

@m4p
Created June 18, 2013 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4p/5805574 to your computer and use it in GitHub Desktop.
Save m4p/5805574 to your computer and use it in GitHub Desktop.
SubEthaEdit Base.mode with file:// URIs. (see line 26)
<?xml version="1.0" encoding="UTF-8"?>
<syntax>
<head>
<name>Default</name> <!-- The definitions title -->
<autocompleteoptions use-spelling-dictionary="yes" />
<charsintokens><![CDATA[_0987654321abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@]]></charsintokens> <!-- Valid Characters for Variables -->
</head>
<states>
<default id="Base" color="#000">
<state id="EmailAndURLContainerState" containerState="yes">
<keywords id="PrefixlessURLs" color="#0000ff" inverted-color="#4939ff" casesensitive="no" type="url" uri-prefix="http://">
<regex>(?i)\b(www\.[A-Z0-9._%-]+\.[A-Z]{2,4})\b</regex>
<regex>(?i)\b([A-Z0-9._%-]+\.net)\b</regex>
<regex>(?i)\b([A-Z0-9._%-]+\.com)\b</regex>
</keywords>
<keywords id="Emails" color="#0000ff" inverted-color="#4939ff" casesensitive="no" type="url" uri-prefix="mailto:">
<regex>(?i)\b([A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4})\b</regex>
</keywords>
<keywords id="URLs" color="#0000ff" inverted-color="#4939ff" casesensitive="no" type="url">
<regex>(?i)\b(file:/\/\[A-Za-z0-9._%-/]+)\b</regex>
<regex>\b([a-zA-Z0-9]+://(?:\p{Alnum}|\p{Punct}|[-\+&amp;@#/%=~_|$!:,.;])*(?:\?\S+)?[^})\]\s\.,])</regex>
<regex>(?i)\b(mailto:(?:\p{Alnum}|\p{Punct}|[._%-])+@(?:\p{Alnum}|\p{Punct}|[._%-])+\.[A-Z]{2,4})\b</regex>
</keywords>
</state>
</default>
</states>
</syntax>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment