Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Handles common syntax for generating DDL
*/
public class DataDefinitionUtil {
private static final String NAME_PATTERN_RGX = "[a-zA-Z_]\\w*$";
private static final String NAME_PATTERN_RGX = "[a-zA-Z_][-\\w]*$";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

today i learned that you can use an unescaped - to match within a character class if its the first (or last) char... i always escape these :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always just use regex101 for this 😄

private static final Pattern NAME_PATTERN = Pattern.compile(NAME_PATTERN_RGX);

/**
Expand Down