generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update(ref): move regex to a separate file(3)
- Loading branch information
Showing
5 changed files
with
58 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Matches a specific pattern inside curly braces: {number1..number2} | ||
export const num_braces_regx = /{(\d+)\.\.(\d+)}/; | ||
|
||
// Matches a pattern of digits separated by hyphens, e.g., 1-2-3-4 | ||
export const num_hyphen_regx = /(\d+-)+\d+/; | ||
|
||
// Matches any sequence of digits, globally. | ||
export const nums_rex = /\d+/g; | ||
|
||
// Matches anything inside curly braces, non-greedy, globally. | ||
export const in_braces_regx = /{.*?}/g; | ||
|
||
// Matches any text inside double curly braces, preceded by "{{this." and followed by "}}" | ||
export const varname_regx = /{{this\.([^{}]*)}}/g; | ||
|
||
// Matches "{{this." or "}}" globally | ||
export const no_varname_regx = /{{this\.|}}/g; |