public class Snippets extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SNIPPET_NAME |
| Constructor and Description |
|---|
Snippets() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
extract(String input)
Simpler variant of
extract(String, String, String) that assumes snippet of the form:
{@code
---START: snippet name ---
Snippet content text. |
static Map<String,String> |
extract(String input,
String startRegex,
String endRegex)
Extracts the text parts between a start and an end tag contained within a larger input text piece.
|
public static final String DEFAULT_SNIPPET_NAME
public static Map<String,String> extract(String input)
extract(String, String, String) that assumes snippet of the form:
---START: snippet name ---
Snippet content text.
---END---
or
---START: snippet name ---
Snippet content text.
---END: some footer text ---
input - the text containing the snippet(s) to extractpublic static Map<String,String> extract(String input, String startRegex, String endRegex)
input - the text containing the snippet(s) to extractstartRegex - a regular expression matching the snippet header. If it contains a match group, the first one
will be used as the snippet's name, otherwise the snipper's name will be set to DEFAULT_SNIPPET_NAME.endRegex - a regular expression matching the snippet footerCopyright © 2014–2017 Github jjYBdx4IL Projects. All rights reserved.