mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
Invert pattern
This commit is contained in:
parent
8aaaed2ef8
commit
b35d5f30f9
1 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ import org.yaml.snakeyaml.Yaml;
|
|||
|
||||
public class YamlStorageWriter implements IStorageWriter
|
||||
{
|
||||
private transient static Pattern pattern = Pattern.compile("\\w");
|
||||
private transient static final Pattern NON_WORD_PATTERN = Pattern.compile("\\W");
|
||||
private transient final PrintWriter writer;
|
||||
private transient static final Yaml YAML = new Yaml();
|
||||
|
||||
|
@ -243,7 +243,7 @@ public class YamlStorageWriter implements IStorageWriter
|
|||
if (data instanceof String || data instanceof Boolean || data instanceof Number)
|
||||
{
|
||||
String output = data.toString();
|
||||
if (pattern.matcher(output).find())
|
||||
if (NON_WORD_PATTERN.matcher(output).find())
|
||||
{
|
||||
writer.print('"');
|
||||
writer.print(output.replace("\"", "\\\""));
|
||||
|
|
Loading…
Reference in a new issue