From d33215d3ebee384386ecbf15368d97054beecf05 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 18 Sep 2018 13:24:56 -0400 Subject: regex, resolve issues with: master file inserts path; url internal link --- org/default_regex.org | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'org/default_regex.org') diff --git a/org/default_regex.org b/org/default_regex.org index 7f0c724..1fd728a 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -146,8 +146,8 @@ static heading_seg_and_above = ctRegex!(`^:?([A-D1])[~] static heading_marker = ctRegex!(`^:?([A-D1-4])[~]`); static heading_anchor_tag = ctRegex!(`^:?[A-D1-4][~]([a-z0-9_.-]+) `,"i"); static heading_identify_anchor_tag = ctRegex!(`^:?[A-D1-4][~]\s+(?:(?:(?:chapter|article|section|clause)\s+[0-9.]+)|(?:[0-9]+))`,"i"); -static heading_extract_named_anchor_tag = ctRegex!(`^:?[A-D1-4][~]\s+(chapter|article|section|clause)\s+((?:[0-9]+[.:])*[0-9]+)(?:[.:;, ]|$)`,"i"); -static heading_extract_unnamed_anchor_tag = ctRegex!(`^:?[A-D1-4][~]\s+((?:[0-9]+.)*[0-9]+)(?:[.:;, ]|$)`); +static heading_extract_named_anchor_tag = ctRegex!(`^:?[A-D1-4][~]\s+(chapter|article|section|clause)\s+((?:[0-9]+[.:])*[0-9]+)(?=[.:;, ]|$)`,"i"); +static heading_extract_unnamed_anchor_tag = ctRegex!(`^:?[A-D1-4][~]\s+((?:[0-9]+.)*[0-9]+)(?=[.:;, ]|$)`); static heading_marker_missing_tag = ctRegex!(`^:?([A-D1-4])[~] `); static heading_anchor_tag_plus_colon = ctRegex!(`^:?([A-D1-4][~])([a-z0-9_.:-]+) `,"i"); static heading_marker_tag_has_colon = ctRegex!(`([:])`); @@ -168,7 +168,7 @@ static para_attribs = ctRegex!(`^_(?:(?:[0-9]) #+END_SRC ** blocked markup -*** blocked markup :block:tic: +*** blocked markup curly & tic :block: #+name: meta_rgx #+BEGIN_SRC d @@ -177,7 +177,7 @@ static block_open = ctRegex!("^((code([.][a- static block_poem_open = ctRegex!("^((poem[{].*?$)|`{3} poem)"); #+END_SRC -** blocked markup tics :block:tic: +*** blocked markup tic :block:tic: #+name: meta_rgx #+BEGIN_SRC d @@ -260,9 +260,9 @@ static note_ref = ctRegex!(`^\S+?noteref_( static webserv_url_doc_root = ctRegex!(`(?P(?Phttps?:\/\/[^ /]+)\/(?P\S*))`, "mg"); static smid_inline_url_generic = ctRegex!(`(?:^|[}(\[ ])(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_#]`, "mg"); static smid_inline_url = ctRegex!(`((?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)[a-zA-Z0-9_]\S*)`, "mg"); -static smid_inline_link_naked_url = ctRegex!(`(?P
^|[ ])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?P[.,;:?!'"]?(?:[ ]|$))`, "mg"); // issue with #link #32
-static smid_inline_link_markup_regular                = ctRegex!(`(?P
^|[ ]|[^\S]?)\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[;:!,?.]?(?:[ )\]]|$))`, "mg"); // NEXT
-static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?P[.,;:?!]?(?:[ ]|$))`, "mg");
+static smid_inline_link_naked_url                     = ctRegex!(`(?P
^|[ (\[])(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤)\S+?)(?=[.,;:?!'"]?([ )\]]|$))`, "mg");
+static smid_inline_link_markup_regular                = ctRegex!(`(?P
^|[ (\[])\{\s*(?P.+?)\s*\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
+static smid_inline_link_endnote_url_helper_punctuated = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[.,;:?!]?([ ]|$))`, "mg");
 static smid_inline_link_endnote_url_helper            = ctRegex!(`\{~\^\s+(?P.+?)\}(?P(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+)`, "mg");
 #+END_SRC
 
@@ -271,10 +271,10 @@ static smid_inline_link_endnote_url_helper            = ctRegex!(`\{~\^\s+(?P(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s+(?P\d+)x(?P\d+)\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?:[;:!,?.]?(?:[ )\]]|$)))`, "mg");
-static smid_image                                      = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?:[;:!,?.]?(?:[ )\]]|$)))`, "mg");
-static smid_mod_image_without_dimensions               = ctRegex!(`\{(?:~\^\s+|\s*)☼\S+\.(?:png|gif|jpg),w0h0\s+(?:.+?)\s*\}(?:image|(?:https?|git):\/\/\S+?)(?:[;:!,?.]?(?:[ )\]]|$))`, "mg");
+static smid_image_generic                              = ctRegex!(`(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*)\S+\.(?:png|gif|jpg).+?\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
+static smid_image_with_dimensions                      = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s+(?P\d+)x(?P\d+)\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
+static smid_image                                      = ctRegex!(`(?P
(?:^|[ ]|[^\S]?)\{(?:~\^\s+|\s*))(?P\S+\.(?:png|gif|jpg))\s*(?P(?:.+?)\s*\}(?:image|(?:(?:https?|git):\/\/|¤?\.\.\/|¤?\.\/|¤|#)\S+?)(?=[;:!,?.]?([ )\]]|$)))`, "mg");
+static smid_mod_image_without_dimensions               = ctRegex!(`\{(?:~\^\s+|\s*)☼\S+\.(?:png|gif|jpg),w0h0\s+(?:.+?)\s*\}(?:image|(?:https?|git):\/\/\S+?)(?=[;:!,?.]?([ )\]]|$))`, "mg");
 #+END_SRC
 
 *** inline markup book index                             :inline:bookindex:
@@ -439,10 +439,10 @@ static pod_content_location                           =
   ctRegex!(`^(?P[a-zA-Z0-9._-]+[.]ss[tm])(?P(?:\s+[a-z]{2}(?:,|$))+)`, "mg");
 static src_fn                                         =
   ctRegex!(`^([/]?(?:[a-zA-Z0-9._-]+/)*)(?P(?P[a-zA-Z0-9._-]+)[.](?Pss[tm]))$`);
-static src_fn_master                                  = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssm)$`);
-static src_fn_text                                    = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]sst)$`);
-static src_fn_insert                                  = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ssi)$`);
-static src_fn_find_inserts                            = ctRegex!(`^(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[im])$`);
+static src_fn_master                                  = ctRegex!(`^(?P/?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]ssm)$`);
+static src_fn_text                                    = ctRegex!(`^(?P/?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]sst)$`);
+static src_fn_insert                                  = ctRegex!(`^(?P/?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]ssi)$`);
+static src_fn_find_inserts                            = ctRegex!(`^(?P/?(?:[a-zA-Z0-9._-]+/)*)(?P[a-zA-Z0-9._-]+[.]ss[im])$`);
 static insert_src_fn_ssi_or_sst                       = ctRegex!(`^<<\s*(?P[a-zA-Z0-9._-]+/)*(?P[a-zA-Z0-9._-]+[.]ss[ti])$`);
 static src_base_parent_dir_name                       = ctRegex!(`[/](?P(?:[a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure
 static src_base_parent_path                           = ctRegex!(`(?P(?:[/a-zA-Z0-9._-]+))(?:/media/text/[a-z]{2})$`); // formalizes dir structure
-- 
cgit v1.2.3