Commits

Eric Knibbe  committed 7d09504 Draft

regex fixes

  • Participants
  • Parent commits 93ba2a9

Comments (0)

Files changed (1)

File bbedit/reStructuredText.plist

 		<string>-\w.:</string>
 		<key>String Pattern</key>
 		<string><![CDATA[(?x:
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?]):(?!\s)
-			([-\w]+:)?(\\:|[-\w+'"=. \t])+
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?]):(?!\s)
+			\w(:(?=\w)|[-\w.+='" \t])*
 			(?<!\s):(?!(?P<end>[\w~@#$%^&*([{<|+=]))      | (?# role/directive option/field name)
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?])\|(?!\s)
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])\|(?!\s)
 			(\\\||[^|\r])+(?<![\s\\])\|_{0,2}(?!(?P>end)) | (?# substitution)
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?])[a-zA-Z0-9]
+			(?<![_~@#$%^&*)\]}>|+=\\;.,!?])[a-zA-Z0-9]
 			[-\w]*__?(?!(?P>end))                         | (?# hyperlink reference)
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?`])`(?!\s)
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?`])`(?!\s)
 			(\\`|[^`])+(?<!\s)`_{0,2}(?!(?P>end))         | (?# phrase reference/interpreted text)
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?])_`(?!\s)
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])_`(?!\s)
 			(\\`|[^`])+(?<!\s)`(?!(?P>end))               | (?# inline internal target)
-			(?<![\w~@#$%^&*)\]}>|\\;.,!?])\[
+			(?<![\w~@#$%^&*)\]}>|+=\\;.,!?])\[
 			([-\w#.]+|\*)\]_(?!(?P>end))                  | (?# footnote/citation reference)
 			(?<=\.\.)[ \t]+\[([-\w#.]+|\*)\](?=\s)        | (?# footnote/citation target)
-			(?<=\.\.)[ \t]+_((\\:|[^:\r])+|`(\\`|[^`\r])+`):(?=[ \t]*$)   (?# hyperlink target)
+			(?<=\.\.)[ \t]+_((\\:|[^:\r])+|`(\\`|[^`\r])+`):(?=[ \t]*)   (?# hyperlink target)
 		)]]></string>
 		<key>Comment Pattern</key>
 		<string><![CDATA[(?x:
-			(\A | ^[ \t]*\r)
-			(?P<pad>[ \t]*)\.\. (
-				[ \t]+ (
-					([-+.a-zA-Z0-9] | (?<!\b)_)+ (?(?=\ ?:)
-						\ ?:(([^:] | :(?=[^\s]))[^\r]* | $)
-						| ([^-+.\w][^\r]* | $)
-					) | [^\w[|\s][^\r]*
-				) | [ \t]*
-			) (
-				\r (
-					(?P=pad)(\.\.[ \t]*)?([ \t]+[^\r]+)? | [ \t]*
-				)
-			)*(\r(?=[ \t]*$) | \Z)
+			(\A | ^[ \t]*\r) (
+				(?P<pad>[ \t]*)\.\. (
+					[ \t]+ (
+						([-+.a-zA-Z0-9] | (?<!\b)_)+ (?(?=\ ?:)
+							\ ?:(([^:] | :(?=[^\s]))[^\r]* | $)
+							| ([^-+.\w][^\r]* | $)
+						) | [^\w[|\s][^\r]*
+					) | [ \t]*
+				) (
+					\r (
+						[ \t]*
+						| (?P=pad)[ \t]+[^\s][^\r]*
+					)
+				)*(\r(?=(?P=pad)\.\.|[ \t]*$) | \Z)
+			)+
 		)]]></string>
 		<key>Function Pattern</key>
 		<string><![CDATA[(?x: