mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 23:00:19 +03:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f25fa0e8 | ||
|
|
94acc0decc | ||
|
|
02593d869a |
No files matched your search
Vendored
+1
-5
@@ -55,8 +55,6 @@ declare module '@vue/runtime-core' {
|
||||
ColoredCard: typeof import('./src/components/ColoredCard.vue')['default']
|
||||
CommandPalette: typeof import('./src/modules/command-palette/command-palette.vue')['default']
|
||||
CommandPaletteOption: typeof import('./src/modules/command-palette/components/command-palette-option.vue')['default']
|
||||
CommonRegex: typeof import('./src/tools/common-regex-memo/common-regex.md')['default']
|
||||
CommonRegexMemo: typeof import('./src/tools/common-regex-memo/common-regex-memo.vue')['default']
|
||||
CrontabGenerator: typeof import('./src/tools/crontab-generator/crontab-generator.vue')['default']
|
||||
CSelect: typeof import('./src/ui/c-select/c-select.vue')['default']
|
||||
'CSelect.demo': typeof import('./src/ui/c-select/c-select.demo.vue')['default']
|
||||
@@ -66,6 +64,7 @@ declare module '@vue/runtime-core' {
|
||||
'CTextCopyable.demo': typeof import('./src/ui/c-text-copyable/c-text-copyable.demo.vue')['default']
|
||||
CTooltip: typeof import('./src/ui/c-tooltip/c-tooltip.vue')['default']
|
||||
'CTooltip.demo': typeof import('./src/ui/c-tooltip/c-tooltip.demo.vue')['default']
|
||||
CurlConverter: typeof import('./src/tools/curl-converter/curl-converter.vue')['default']
|
||||
DateTimeConverter: typeof import('./src/tools/date-time-converter/date-time-converter.vue')['default']
|
||||
'DemoHome.page': typeof import('./src/ui/demo/demo-home.page.vue')['default']
|
||||
DemoWrapper: typeof import('./src/ui/demo/demo-wrapper.vue')['default']
|
||||
@@ -134,7 +133,6 @@ declare module '@vue/runtime-core' {
|
||||
NConfigProvider: typeof import('naive-ui')['NConfigProvider']
|
||||
NDivider: typeof import('naive-ui')['NDivider']
|
||||
NEllipsis: typeof import('naive-ui')['NEllipsis']
|
||||
NForm: typeof import('naive-ui')['NForm']
|
||||
NFormItem: typeof import('naive-ui')['NFormItem']
|
||||
NGi: typeof import('naive-ui')['NGi']
|
||||
NGrid: typeof import('naive-ui')['NGrid']
|
||||
@@ -147,9 +145,7 @@ declare module '@vue/runtime-core' {
|
||||
NLayoutSider: typeof import('naive-ui')['NLayoutSider']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSlider: typeof import('naive-ui')['NSlider']
|
||||
NSpin: typeof import('naive-ui')['NSpin']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OtpCodeGeneratorAndValidator: typeof import('./src/tools/otp-code-generator-and-validator/otp-code-generator-and-validator.vue')['default']
|
||||
PasswordStrengthAnalyser: typeof import('./src/tools/password-strength-analyser/password-strength-analyser.vue')['default']
|
||||
|
||||
+2
-2
@@ -55,6 +55,7 @@
|
||||
"cron-validator": "^1.3.1",
|
||||
"cronstrue": "^2.26.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"curlconverter": "^4.10.1",
|
||||
"date-fns": "^2.29.3",
|
||||
"dompurify": "^3.0.6",
|
||||
"emojilib": "^3.0.10",
|
||||
@@ -138,6 +139,5 @@
|
||||
"vitest": "^0.34.0",
|
||||
"workbox-window": "^7.0.0",
|
||||
"zx": "^7.2.1"
|
||||
},
|
||||
"packageManager": "pnpm@8.15.3"
|
||||
}
|
||||
}
|
||||
Generated
+77
-9
@@ -65,6 +65,9 @@ dependencies:
|
||||
crypto-js:
|
||||
specifier: ^4.1.1
|
||||
version: 4.1.1
|
||||
curlconverter:
|
||||
specifier: ^4.10.1
|
||||
version: 4.10.1
|
||||
date-fns:
|
||||
specifier: ^2.29.3
|
||||
version: 2.29.3
|
||||
@@ -3354,7 +3357,7 @@ packages:
|
||||
dependencies:
|
||||
'@unhead/dom': 0.5.1
|
||||
'@unhead/schema': 0.5.1
|
||||
'@vueuse/shared': 10.8.0(vue@3.3.4)
|
||||
'@vueuse/shared': 11.2.0(vue@3.3.4)
|
||||
unhead: 0.5.1
|
||||
vue: 3.3.4
|
||||
transitivePeerDependencies:
|
||||
@@ -3996,10 +3999,10 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@vueuse/shared@10.8.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-dUdy6zwHhULGxmr9YUg8e+EnB39gcM4Fe2oKBSrh3cOsV30JcMPtsyuspgFCUo5xxFNaeMf/W2yyKfST7Bg8oQ==}
|
||||
/@vueuse/shared@11.2.0(vue@3.3.4):
|
||||
resolution: {integrity: sha512-VxFjie0EanOudYSgMErxXfq6fo8vhr5ICI+BuE3I9FnX7ePllEsVrRQ7O6Q1TLgApeLuPKcHQxAXpP+KnlrJsg==}
|
||||
dependencies:
|
||||
vue-demi: 0.14.7(vue@3.3.4)
|
||||
vue-demi: 0.14.10(vue@3.3.4)
|
||||
transitivePeerDependencies:
|
||||
- '@vue/composition-api'
|
||||
- vue
|
||||
@@ -4715,6 +4718,20 @@ packages:
|
||||
/csstype@3.1.2:
|
||||
resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
|
||||
|
||||
/curlconverter@4.10.1:
|
||||
resolution: {integrity: sha512-cMV9ZsIBgZCeKiTqOvxtBGB58heQbrulPvtff4IbFunbDIuGWu8ZCDlCIEr74aNGCOfQRv9aery8I2GpYGBzyw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
jsesc: 3.0.2
|
||||
lossless-json: 4.0.1
|
||||
tree-sitter: 0.21.1
|
||||
tree-sitter-bash: 0.21.0(tree-sitter@0.21.1)
|
||||
web-tree-sitter: 0.22.6
|
||||
yamljs: 0.3.0
|
||||
transitivePeerDependencies:
|
||||
- tree_sitter
|
||||
dev: false
|
||||
|
||||
/dash-get@1.0.2:
|
||||
resolution: {integrity: sha512-4FbVrHDwfOASx7uQVxeiCTo7ggSdYZbqs8lH+WU6ViypPlDbe9y6IP5VVUDQBv9DcnyaiPT5XT0UWHgJ64zLeQ==}
|
||||
dev: false
|
||||
@@ -6566,7 +6583,6 @@ packages:
|
||||
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
|
||||
engines: {node: '>=6'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/json-parse-even-better-errors@2.3.1:
|
||||
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
|
||||
@@ -6720,6 +6736,10 @@ packages:
|
||||
is-unicode-supported: 0.1.0
|
||||
dev: true
|
||||
|
||||
/lossless-json@4.0.1:
|
||||
resolution: {integrity: sha512-l0L+ppmgPDnb+JGxNLndPtJZGNf6+ZmVaQzoxQm3u6TXmhdnsA+YtdVR8DjzZd/em58686CQhOFDPewfJ4l7MA==}
|
||||
dev: false
|
||||
|
||||
/loupe@2.3.6:
|
||||
resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==}
|
||||
dependencies:
|
||||
@@ -7050,6 +7070,15 @@ packages:
|
||||
tslib: 2.5.0
|
||||
dev: false
|
||||
|
||||
/node-addon-api@7.1.1:
|
||||
resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==}
|
||||
dev: false
|
||||
|
||||
/node-addon-api@8.1.0:
|
||||
resolution: {integrity: sha512-yBY+qqWSv3dWKGODD6OGE6GnTX7Q2r+4+DfpqxHSHh8x0B4EKP9+wVGLS6U/AM1vxSNNmUEuIV5EGhYwPpfOwQ==}
|
||||
engines: {node: ^18 || ^20 || >= 21}
|
||||
dev: false
|
||||
|
||||
/node-domexception@1.0.0:
|
||||
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
|
||||
engines: {node: '>=10.5.0'}
|
||||
@@ -7073,6 +7102,11 @@ packages:
|
||||
engines: {node: '>= 6.13.0'}
|
||||
dev: false
|
||||
|
||||
/node-gyp-build@4.8.1:
|
||||
resolution: {integrity: sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/node-releases@2.0.12:
|
||||
resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==}
|
||||
dev: true
|
||||
@@ -8488,6 +8522,30 @@ packages:
|
||||
punycode: 2.3.0
|
||||
dev: true
|
||||
|
||||
/tree-sitter-bash@0.21.0(tree-sitter@0.21.1):
|
||||
resolution: {integrity: sha512-UuXf+wliu1mmS/O2Iz7OQghExM4a+lk+GaVPndZVpAJnFuzanaN33UcHOsrmngHxaOXHz5JSZrwp6i2qM/PKag==}
|
||||
requiresBuild: true
|
||||
peerDependencies:
|
||||
tree-sitter: ^0.21.0
|
||||
tree_sitter: '*'
|
||||
peerDependenciesMeta:
|
||||
tree_sitter:
|
||||
optional: true
|
||||
dependencies:
|
||||
node-addon-api: 7.1.1
|
||||
node-gyp-build: 4.8.1
|
||||
tree-sitter: 0.21.1
|
||||
web-tree-sitter: 0.21.0
|
||||
dev: false
|
||||
|
||||
/tree-sitter@0.21.1:
|
||||
resolution: {integrity: sha512-7dxoA6kYvtgWw80265MyqJlkRl4yawIjO7S5MigytjELkX43fV2WsAXzsNfO7sBpPPCF5Gp0+XzHk0DwLCq3xQ==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-addon-api: 8.1.0
|
||||
node-gyp-build: 4.8.1
|
||||
dev: false
|
||||
|
||||
/treemate@0.3.11:
|
||||
resolution: {integrity: sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==}
|
||||
dev: false
|
||||
@@ -9143,8 +9201,8 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.14.5(vue@3.3.4):
|
||||
resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
|
||||
/vue-demi@0.14.10(vue@3.3.4):
|
||||
resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
@@ -9158,8 +9216,8 @@ packages:
|
||||
vue: 3.3.4
|
||||
dev: false
|
||||
|
||||
/vue-demi@0.14.7(vue@3.3.4):
|
||||
resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==}
|
||||
/vue-demi@0.14.5(vue@3.3.4):
|
||||
resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
@@ -9276,6 +9334,14 @@ packages:
|
||||
engines: {node: '>= 8'}
|
||||
dev: true
|
||||
|
||||
/web-tree-sitter@0.21.0:
|
||||
resolution: {integrity: sha512-iJ+QJ6ikN9D9cG7Kh6q3KtAstYFUQbYZ8OjuPEJYWfj2kLrmp5I3C2n6WjE1Y3jvj7nJbkcrJytJGWUEhCxn+g==}
|
||||
dev: false
|
||||
|
||||
/web-tree-sitter@0.22.6:
|
||||
resolution: {integrity: sha512-hS87TH71Zd6mGAmYCvlgxeGDjqd9GTeqXNqTT+u0Gs51uIozNIaaq/kUAbV/Zf56jb2ZOyG8BxZs2GG9wbLi6Q==}
|
||||
dev: false
|
||||
|
||||
/webidl-conversions@4.0.2:
|
||||
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
|
||||
dev: true
|
||||
@@ -9449,6 +9515,7 @@ packages:
|
||||
|
||||
/workbox-google-analytics@7.0.0:
|
||||
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
|
||||
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
|
||||
dependencies:
|
||||
workbox-background-sync: 7.0.0
|
||||
workbox-core: 7.0.0
|
||||
@@ -9592,6 +9659,7 @@ packages:
|
||||
|
||||
/yamljs@0.3.0:
|
||||
resolution: {integrity: sha512-C/FsVVhht4iPQYXOInoxUM/1ELSf9EsgKH34FofQOp6hwCPrW4vG4w5++TED3xRUo8gD7l0P1J1dLlDYzODsTQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
argparse: 1.0.10
|
||||
glob: 7.2.3
|
||||
|
||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
@@ -1,25 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import Memo from './common-regex.md';
|
||||
|
||||
const themeVars = useThemeVars();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<Memo style="overflow-x: auto;" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep(pre) {
|
||||
margin: 0;
|
||||
padding: 15px 22px;
|
||||
background-color: v-bind('themeVars.cardColor');
|
||||
border-radius: 4px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
::v-deep(a) {
|
||||
color: v-bind('themeVars.textColor3');
|
||||
}
|
||||
</style>
|
||||
@@ -1,174 +0,0 @@
|
||||
|
||||
### Commonly used Regex
|
||||
|
||||
#### 1\. Digits
|
||||
|
||||
* [Whole Numbers](https://www.regexpal.com/?fam=104020) – `/^\d+$/`
|
||||
* [Decimal Numbers](https://www.regexpal.com/?fam=104021) – `/^\d*\.\d+$/`
|
||||
* [Whole + Decimal Numbers](https://www.regexpal.com/?fam=104022) – `/^\d*(\.\d+)?$/`
|
||||
* [Negative, Positive Whole + Decimal Numbers](https://www.regexpal.com/?fam=104023) – `/^-?\d*(\.\d+)?$/`
|
||||
* [Whole + Decimal + Fractions](https://www.regexpal.com/94462) – `/[-]?[0-9]+[,.]?[0-9]*([\/][0-9]+[,.]?[0-9]*)*/`
|
||||
|
||||
#### 2\. Alphanumeric Characters
|
||||
|
||||
* [Alphanumeric without space](https://www.regexpal.com/?fam=104024) – `/^[a-zA-Z0-9]*$/`
|
||||
* [Alphanumeric with space](https://www.regexpal.com/?fam=104025) – `/^[a-zA-Z0-9 ]*$/`
|
||||
|
||||
#### 3\. Email
|
||||
|
||||
* [Common email Ids](https://www.regexpal.com/?fam=104026) – `/^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})*$/`
|
||||
* [Uncommon email ids](https://www.regexpal.com/?fam=104027) – `/^([a-z0-9_\.\+-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/`
|
||||
|
||||
#### 4\. Password Strength
|
||||
|
||||
* [Complex](https://www.regexpal.com/?fam=104028): Should have 1 lowercase letter, 1 uppercase letter, 1 number, 1 special character and be at least 8 characters long
|
||||
|
||||
/(?=(.\*\[0-9\]))(?=.\*\[\\!@#$%^&\*()\\\\\[\\\]{}\\-\_+=~\`|:;"'<>,./?\])(?=.\*\[a-z\])(?=(.\*\[A-Z\]))(?=(.\*)).{8,}/
|
||||
|
||||
* [Moderate](https://www.regexpal.com/?fam=104029): Should have 1 lowercase letter, 1 uppercase letter, 1 number, and be at least 8 characters long
|
||||
|
||||
/(?=(.\*\[0-9\]))((?=.\*\[A-Za-z0-9\])(?=.\*\[A-Z\])(?=.\*\[a-z\]))^.{8,}$/
|
||||
|
||||
#### 5\. Username
|
||||
|
||||
* [Alphanumeric string](https://www.regexpal.com/?fam=104030) that may include \_ and – having a length of 3 to 16 characters – `/^[a-z0-9_-]{3,16}$/`
|
||||
|
||||
#### 6\. URL
|
||||
|
||||
* Include [http(s) Protocol](https://www.regexpal.com/?fam=104034)
|
||||
|
||||
```
|
||||
/https?:\\/\\/(www\\.)?\[-a-zA-Z0-9@:%.\_\\+~#=\]{2,256}\\.\[a-z\]{2,6}\\b(\[-a-zA-Z0-9@:%\_\\+.~#()?&//=\]\*)/
|
||||
```
|
||||
|
||||
* [Protocol Optional](https://www.regexpal.com/?fam=104035)
|
||||
|
||||
```
|
||||
/(https?:\\/\\/)?(www\\.)?\[-a-zA-Z0-9@:%.\_\\+~#=\]{2,256}\\.\[a-z\]{2,6}\\b(\[-a-zA-Z0-9@:%\_\\+.~#?&//=\]\*)/
|
||||
```
|
||||
|
||||
#### 7\. IP Address
|
||||
|
||||
* [IPv4 address](https://www.regexpal.com/?fam=104036)
|
||||
```
|
||||
/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/
|
||||
```
|
||||
* [IPv6 address](https://www.regexpal.com/?fam=104037)
|
||||
```
|
||||
/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/
|
||||
```
|
||||
|
||||
* Both [IPv4, IPv6 addresses](https://www.regexpal.com/?fam=104038)
|
||||
```
|
||||
/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/`
|
||||
```
|
||||
|
||||
#### 8\. Dates
|
||||
|
||||
* Date Format [YYYY-MM-dd](https://www.regexpal.com/?fam=104039) using separator `-`
|
||||
`/([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))/`
|
||||
* Date Format [dd-MM-YYYY](https://regexr.com/?346hf) using separators `-` or `.` or `/`
|
||||
`/^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/`
|
||||
* Date Format [dd-mmm-YYYY](https://regexr.com/39tr1) using separators `-` or `.` or `/`
|
||||
`/^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]|(?:Jan|Mar|May|Jul|Aug|Oct|Dec)))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2]|(?:Jan|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)(?:0?2|(?:Feb))\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9]|(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep))|(?:1[0-2]|(?:Oct|Nov|Dec)))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/`
|
||||
|
||||
#### 9\. Time
|
||||
|
||||
* Time Format [HH:MM 12-hour](https://www.regexpal.com/?fam=104040), optional leading 0
|
||||
|
||||
`/^(0?[1-9]|1[0-2]):[0-5][0-9]$/`
|
||||
|
||||
* Time Format HH:MM 12-hour, optional leading 0, **[Meridiems (AM/PM)](https://www.regexpal.com/?fam=104041)**
|
||||
|
||||
`/((1[0-2]|0?[1-9]):([0-5][0-9]) ?([AaPp][Mm]))/`
|
||||
|
||||
* Time Format [HH:MM 24-hour](https://www.regexpal.com/?fam=104042) with leading 0
|
||||
|
||||
`/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/`
|
||||
|
||||
* Time Format [HH:MM 24-hour, optional leading 0](https://www.regexpal.com/?fam=104043)
|
||||
|
||||
`/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/`
|
||||
|
||||
* Time Format [HH:MM:SS 24-hour](https://www.regexpal.com/?fam=104044)
|
||||
|
||||
`/(?:[01]\d|2[0123]):(?:[012345]\d):(?:[012345]\d)/`
|
||||
|
||||
#### 10\. HTML Tags
|
||||
|
||||
* [Elements with Attributes](https://www.regexpal.com/95941) `/<\/?[\w\s]*>|<.+[\W]>/`
|
||||
|
||||
#### 11\. Javascript Handlers
|
||||
|
||||
* [Inline JS handler](https://www.regexpal.com/?fam=104055) `/\bon\w+=\S+(?=.*>)/`
|
||||
* [Inline JS handler with element](https://www.regexpal.com/94641) `/(?:<[^>]+\s)(on\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/`
|
||||
|
||||
#### 12\. Slug
|
||||
|
||||
* [Slug](https://www.regexpal.com/?fam=104056) `/^[a-z0-9]+(?:-[a-z0-9]+)*$/`
|
||||
|
||||
#### 13\. Match Duplicates in a String
|
||||
|
||||
* [Search Duplicates](https://www.regexpal.com/?fam=104060) `/(\b\w+\b)(?=.*\b\1\b)/`
|
||||
|
||||
#### 14\. Phone Numbers
|
||||
|
||||
* [International Phone Numbers](https://www.regexpal.com/?fam=99127) – with optional country code/extension
|
||||
```
|
||||
`/* International Phone Numbers */`
|
||||
/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:``#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/
|
||||
```
|
||||
|
||||
_Note:_ Use regex for validating phone numbers **only** if you don’t have the choice to use a library. There are [several libraries](https://stackoverflow.com/a/15644461/4717533) that handle phone numbers more accurately and should be used instead.
|
||||
|
||||
#### 15\. File Path
|
||||
|
||||
* [File Path with Filename and extension](https://www.regexpal.com/?fam=104047)
|
||||
|
||||
```
|
||||
/((\\/|\\\\|\\/\\/|https?:\\\\\\\\|https?:\\/\\/)\[a-z0-9 \_@\\-^!#$%&+={}.\\/\\\\\\\[\\\]\]+)+\\.\[a-z\]+$/
|
||||
```
|
||||
|
||||
* File Path with optional Filename, extension
|
||||
|
||||
```
|
||||
/^(.+)/(\[^/\]+)$/
|
||||
```
|
||||
|
||||
* [File Name with extension](https://www.regexpal.com/?fam=104048) having 3 chars
|
||||
|
||||
```
|
||||
/^\[\\w,\\s-\]+\\.\[A-Za-z\]{3}$/
|
||||
```
|
||||
|
||||
### Additional Regexes
|
||||
|
||||
#### 1\. Zip codes
|
||||
|
||||
There is **NO** single Regex that can handle all zip codes given that zip codes around the world do not follow a common pattern. Here is a [list](https://stackoverflow.com/a/7185241/4717533) that contains Regex specific to each country.
|
||||
|
||||
#### 2\. Payment Validation
|
||||
|
||||
Here is a [link](https://www.regular-expressions.info/creditcard.html) that contains regex for validating leading Credit cards like Visa, Mastercard and so on.
|
||||
|
||||
#### 3\. Identity Documents
|
||||
|
||||
* Social Security Number – [Ref](https://www.codeproject.com/Articles/651609/Validating-Social-Security-Numbers-through-Regular)
|
||||
|
||||
```
|
||||
/\* can use either hypen(-) or space( ) character as separator \*/
|
||||
|
||||
/^((?!219-09-9999|078-05-1120)(?!666|000|9\\d{2})\\d{3}-(?!00)\\d{2}-(?!0{4})\\d{4})|((?!219 09 9999|078 05 1120)(?!666|000|9\\d{2})\\d{3} (?!00)\\d{2} (?!0{4})\\d{4})|((?!219099999|078051120)(?!666|000|9\\d{2})\\d{3}(?!00)\\d{2}(?!0{4})\\d{4})$/
|
||||
```
|
||||
|
||||
* Passport – `/^[A-PR-WY][1-9]\d\s?\d{4}[1-9]$/`
|
||||
|
||||
#### References
|
||||
* [https://www.codeproject.com/validate-passport-number](https://www.codeproject.com/Questions/1046445/How-to-validate-passport-number-using-javascript)
|
||||
* [https://gist.github.com/](https://gist.github.com/nerdsrescueme/1237767)
|
||||
* [https://code.tutsplus.com/regular-expressions](https://code.tutsplus.com/tutorials/8-regular-expressions-you-should-know--net-6149)
|
||||
* [https://www.regular-expressions.info](https://www.regular-expressions.info/)
|
||||
* [http://www.regexlib.com/](http://www.regexlib.com/)
|
||||
* [https://projects.lukehaas.me/regexhub/](https://projects.lukehaas.me/regexhub/)
|
||||
* [http://wiki.zoolz.com/commonly-used-regular-expressions/](http://wiki.zoolz.com/commonly-used-regular-expressions/)
|
||||
* [https://www.smashingmagazine.com/advanced-regular-expressions/](https://www.smashingmagazine.com/2009/05/introduction-to-advanced-regular-expressions/)
|
||||
@@ -1,12 +0,0 @@
|
||||
import { FileText } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Common Regex Cheatsheet',
|
||||
path: '/common-regex-memo',
|
||||
description: 'Cheatsheet for common regex patterns',
|
||||
keywords: ['common', 'regex', 'memo', 'cheatsheet'],
|
||||
component: () => import('./common-regex-memo.vue'),
|
||||
icon: FileText,
|
||||
createdAt: new Date('2024-05-11'),
|
||||
});
|
||||
@@ -0,0 +1,133 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
type Warnings, toAnsible, toAnsibleWarn, toCFML, toCFMLWarn, toCSharp,
|
||||
toCSharpWarn, toClojure, toClojureWarn, toDart, toDartWarn, toElixir, toElixirWarn, toGo,
|
||||
toGoWarn, toHTTP, toHTTPWarn, toHarString, toHarStringWarn, toHttpie, toHttpieWarn, toJava,
|
||||
toJavaHttpUrlConnection, toJavaHttpUrlConnectionWarn, toJavaJsoup, toJavaJsoupWarn, toJavaOkHttp,
|
||||
toJavaOkHttpWarn, toJavaScript, toJavaScriptJquery, toJavaScriptJqueryWarn, toJavaScriptWarn, toJavaScriptXHR,
|
||||
toJavaScriptXHRWarn, toJavaWarn, toJsonString, toJsonStringWarn, toJulia, toJuliaWarn, toKotlin, toKotlinWarn, toLua,
|
||||
toLuaWarn, toMATLAB, toMATLABWarn, toNode, toNodeAxios, toNodeAxiosWarn, toNodeGot, toNodeGotWarn, toNodeHttp,
|
||||
toNodeHttpWarn, toNodeKy, toNodeKyWarn, toNodeRequest, toNodeRequestWarn, toNodeSuperAgent, toNodeSuperAgentWarn,
|
||||
toNodeWarn, toOCaml, toOCamlWarn, toObjectiveC, toObjectiveCWarn, toPerl, toPerlWarn, toPhp, toPhpGuzzle,
|
||||
toPhpGuzzleWarn, toPhpRequests, toPhpRequestsWarn, toPhpWarn, toPowershellRestMethod,
|
||||
toPowershellRestMethodWarn, toPowershellWebRequest, toPowershellWebRequestWarn, toPython, toPythonHttp, toPythonHttpWarn, toPythonWarn,
|
||||
toR, toRWarn, toRuby, toRubyWarn, toRust, toRustWarn, toSwift, toSwiftWarn, toWget,
|
||||
toWgetWarn,
|
||||
} from 'curlconverter';
|
||||
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||
|
||||
const translate = {
|
||||
'ansible': [toAnsible, toAnsibleWarn],
|
||||
'cfml': [toCFML, toCFMLWarn],
|
||||
'clojure': [toClojure, toClojureWarn],
|
||||
'csharp': [toCSharp, toCSharpWarn],
|
||||
'c#': [toCSharp, toCSharpWarn],
|
||||
'browser': [toJavaScript, toJavaScriptWarn],
|
||||
'dart': [toDart, toDartWarn],
|
||||
'elixir': [toElixir, toElixirWarn],
|
||||
'go': [toGo, toGoWarn],
|
||||
'golang': [toGo, toGoWarn],
|
||||
'har': [toHarString, toHarStringWarn],
|
||||
'http': [toHTTP, toHTTPWarn],
|
||||
'httpie': [toHttpie, toHttpieWarn],
|
||||
'java': [toJava, toJavaWarn],
|
||||
'java-httpurlconnection': [
|
||||
toJavaHttpUrlConnection,
|
||||
toJavaHttpUrlConnectionWarn,
|
||||
],
|
||||
'java-jsoup': [toJavaJsoup, toJavaJsoupWarn],
|
||||
'java-okhttp': [toJavaOkHttp, toJavaOkHttpWarn],
|
||||
'javascript': [toJavaScript, toJavaScriptWarn],
|
||||
'javascript-axios': [toNodeAxios, toNodeAxiosWarn],
|
||||
'javascript-fetch': [toJavaScript, toJavaScriptWarn],
|
||||
'javascript-got': [toNodeGot, toNodeGotWarn],
|
||||
'javascript-ky': [toNodeKy, toNodeKyWarn],
|
||||
'javascript-jquery': [toJavaScriptJquery, toJavaScriptJqueryWarn],
|
||||
'javascript-request': [toNodeRequest, toNodeRequestWarn],
|
||||
'javascript-superagent': [toNodeSuperAgent, toNodeSuperAgentWarn],
|
||||
'javascript-xhr': [toJavaScriptXHR, toJavaScriptXHRWarn],
|
||||
'json': [toJsonString, toJsonStringWarn],
|
||||
'julia': [toJulia, toJuliaWarn],
|
||||
'kotlin': [toKotlin, toKotlinWarn],
|
||||
'lua': [toLua, toLuaWarn],
|
||||
'matlab': [toMATLAB, toMATLABWarn],
|
||||
'node': [toNode, toNodeWarn],
|
||||
'nodejs': [toNode, toNodeWarn],
|
||||
'nodejs-axios': [toNodeAxios, toNodeAxiosWarn],
|
||||
'nodejs-got': [toNodeGot, toNodeGotWarn],
|
||||
'nodejs-http': [toNodeHttp, toNodeHttpWarn],
|
||||
'nodejs-ky': [toNodeKy, toNodeKyWarn],
|
||||
'nodejs-jquery': [toJavaScriptJquery, toJavaScriptJqueryWarn],
|
||||
'nodejs-request': [toNodeRequest, toNodeRequestWarn],
|
||||
'nodejs-superagent': [toNodeSuperAgent, toNodeSuperAgentWarn],
|
||||
'nodejs-xhr': [toJavaScriptXHR, toJavaScriptXHRWarn],
|
||||
'objc': [toObjectiveC, toObjectiveCWarn],
|
||||
'objective-c': [toObjectiveC, toObjectiveCWarn],
|
||||
'ocaml': [toOCaml, toOCamlWarn],
|
||||
'perl': [toPerl, toPerlWarn],
|
||||
'php': [toPhp, toPhpWarn],
|
||||
'php-guzzle': [toPhpGuzzle, toPhpGuzzleWarn],
|
||||
'php-requests': [toPhpRequests, toPhpRequestsWarn],
|
||||
'powershell': [toPowershellRestMethod, toPowershellRestMethodWarn],
|
||||
'powershell-webrequest': [
|
||||
toPowershellWebRequest,
|
||||
toPowershellWebRequestWarn,
|
||||
],
|
||||
'python': [toPython, toPythonWarn],
|
||||
'python-http': [toPythonHttp, toPythonHttpWarn],
|
||||
'r': [toR, toRWarn],
|
||||
'ruby': [toRuby, toRubyWarn],
|
||||
'rust': [toRust, toRustWarn],
|
||||
'swift': [toSwift, toSwiftWarn],
|
||||
'wget': [toWget, toWgetWarn],
|
||||
};
|
||||
|
||||
const language = ref('python');
|
||||
const curl = ref('curl --data "hello=world" example.com');
|
||||
const inlang = computed(() => {
|
||||
try {
|
||||
let curlCommand = curl.value;
|
||||
if (!curlCommand.startsWith('curl ')) {
|
||||
curlCommand = `curl ${curlCommand}`;
|
||||
}
|
||||
const [translated, warnings] = translate[language.value as (keyof typeof translate)][1](curlCommand);
|
||||
return {
|
||||
translated,
|
||||
warnings,
|
||||
};
|
||||
}
|
||||
catch (e: any) {
|
||||
return {
|
||||
translated: e.toString(),
|
||||
warnings: [],
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<c-input-text
|
||||
v-model:value="curl"
|
||||
size="large"
|
||||
placeholder="Your curl command"
|
||||
mb-3
|
||||
/>
|
||||
|
||||
<c-select
|
||||
v-model:value="language"
|
||||
searchable
|
||||
label="Language:"
|
||||
:options="Object.keys(translate)"
|
||||
/>
|
||||
|
||||
<n-divider />
|
||||
|
||||
<n-form-item label="Curl language equivalent:">
|
||||
<TextareaCopyable :value="inlang.translated as string" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Warnings:">
|
||||
<TextareaCopyable style="color: red" :value="(inlang.warnings as Warnings || []).map(w => w[1]).join('\n')" />
|
||||
</n-form-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ExternalLink } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Curl Converter',
|
||||
path: '/curl-converter',
|
||||
description: 'Generate common coding languages version of provided curl command line',
|
||||
keywords: ['curl', 'code', 'language', 'generator'],
|
||||
component: () => import('./curl-converter.vue'),
|
||||
icon: ExternalLink,
|
||||
createdAt: new Date('2024-04-20'),
|
||||
});
|
||||
+2
-2
@@ -6,7 +6,7 @@ import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||
|
||||
import { tool as textToUnicode } from './text-to-unicode';
|
||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||
import { tool as commonRegexMemo } from './common-regex-memo';
|
||||
import { tool as curlConverter } from './curl-converter';
|
||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||
import { tool as macAddressGenerator } from './mac-address-generator';
|
||||
@@ -149,7 +149,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
dockerRunToDockerComposeConverter,
|
||||
xmlFormatter,
|
||||
yamlViewer,
|
||||
commonRegexMemo,
|
||||
curlConverter,
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -113,4 +113,11 @@ export default defineConfig({
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
supported: {
|
||||
'top-level-await': true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user