Skip to content

Instantly share code, notes, and snippets.

@msoutopico
Last active March 23, 2021 20:35
Show Gist options
  • Save msoutopico/fc28e2f5f6c17984c2735bc61d1037a3 to your computer and use it in GitHub Desktop.
Save msoutopico/fc28e2f5f6c17984c2735bc61d1037a3 to your computer and use it in GitHub Desktop.
# HTML TAGS
<
/?
(EMPTY|[bui]|sup|sub|strong|strike|small|ul|ol|li|a|em|br\s*/?|img|var|span|div|p|run\d|style|center)
(\s+[^<>]+)?
>
| # PAQ CODE-ONLY SEGMENTS
^((PA|Q)\d[A-Z0-9]+)$
| # ESCAPED BREAK TAG
<br\s?/>
| # SYMBOLS
[▼►⇑●∠]
| # ESCAPED HEXADECIMAL ENTITY REFERENCES
&#x\w+?;
| # FORMATTING PLACEHOLDERS
%s
| # IPSOS BLOCK
(
# Hashed entities between {} (eg. {#\.CLROFF}, {#\.CLRON}, {#CLROFF}, {#CLRON}, {#Country}, {#Q12_recode}, {#Q41_ins}, {#Q41A_recode}, {#Q41B_recode}, {#Q41C_recode}, {#Q41D_recode}, {#Q41E_recode}, {#Q41F_recode}, {#Q41G_recode}, {#Q41I_recode}, {#Q41J_recode}, {#Q43_Currency})
\{#.+?\}
|
# Entities preceded by @ between {} (eg. {@Q2_loop}, {@}), needed for IPSOS
\{@.*?\}
|
# Upper case entities between {} (eg. {COUNTRY}, {ANSWER}, {CATEGORY}, {LENGTH}, {MAXANSWERS}, {MAXLENGTH}, {MINANSWERS}, {MINLENGTH}, {QUESTION_NUMBER}, {QUESTION}, {RANGE})
\{[A-Z_]+\}
|
# Upper case entities between [] (eg. [COUNTRY])
\[[A-Z_]+\]
)
@msoutopico
Copy link
Author

msoutopico commented Feb 16, 2021

((\s*|^)#\s.*)?(\n|\Z)|^\s+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment