├── .github └── FUNDING.yml ├── .gitignore ├── .npmrc ├── .vscode ├── extensions.json └── settings.json ├── LICENSE ├── README.md ├── index.html ├── netlify.toml ├── package.json ├── pnpm-lock.yaml ├── public ├── favicon.png ├── favicon.svg ├── pwa-192x192.png ├── pwa-512x512.png ├── robots.txt └── safari-pinned-tab.svg ├── src ├── App.vue ├── components │ ├── Editor.vue │ ├── ErrorPopup.vue │ ├── NavBar.vue │ ├── ResultArea.vue │ └── SearchArea.vue ├── logics │ ├── dark.ts │ ├── index.ts │ └── store.ts ├── main.ts ├── modes │ └── regex.ts ├── pages │ ├── [...all].vue │ └── index.vue ├── shims.d.ts └── styles │ └── main.css ├── tailwind.config.ts ├── tsconfig.json └── vite.config.ts /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: antfu 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vite-ssg-dist 3 | .vite-ssg-temp 4 | *.local 5 | dist 6 | dist-ssr 7 | node_modules 8 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "johnsoncodehk.volar", 4 | "lokalise.i18n-ally", 5 | "antfu.iconify", 6 | "dbaeumer.vscode-eslint" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "volar.tsPlugin": true, 3 | "i18n-ally.localesPaths": "locales", 4 | "i18n-ally.keystyle": "nested", 5 | "i18n-ally.sortKeys": true, 6 | "cSpell.words": [ 7 | "Vitesse" 8 | ], 9 | "typescript.tsdk": "node_modules/typescript/lib", 10 | "volar.tsPluginStatus": false, 11 | "svg.preview.background": "transparent" 12 | } 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Anthony Fu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

ReX

5 |

6 | Transform texts with RegExp like a Pro. 7 |

8 |

9 | Go to App 10 |

11 | 12 | ## Motivation 13 | 14 | Sometimes you need to do some clean up or transform for texts in batches. You can either edit manually line-by-line, using multi-cursors in your editor, apply find & replace with RegExp, or write a script for that. 15 | 16 | Editing manually sometime could be laborious, writing a script could be complicated and overkill. Replacing via RegExp sounds like a good options to me, but somehow most editors can only do replacement but lack of the feature "keep only what matched". 17 | 18 | Introducing **ReX**, an tiny app for me to do the text transformation without causing my headache. It was wrote in like 4 hours, but I will try to add more features as needed along the way. 19 | 20 | So, yeah, enjoy. I would be glad if you find it useful as well. 21 | 22 | 23 | ## Sponsors 24 | 25 |

26 | 27 | 28 | 29 |

30 | 31 | ## License 32 | 33 | MIT License © 2021 [Anthony Fu](https://github.com/antfu) 34 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build.environment] 2 | NPM_FLAGS = "--prefix=/dev/null" 3 | NODE_VERSION = "14" 4 | 5 | [build] 6 | publish = "dist" 7 | command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build" 8 | 9 | [[redirects]] 10 | from = "/*" 11 | to = "/index.html" 12 | status = 200 13 | 14 | [[headers]] 15 | for = "/manifest.webmanifest" 16 | [headers.values] 17 | Content-Type = "application/manifest+json" -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite --port 3333 --open", 5 | "build": "cross-env NODE_ENV=production vite build" 6 | }, 7 | "dependencies": { 8 | "@vueuse/core": "^4.2.2", 9 | "@vueuse/head": "^0.3.1", 10 | "codemirror": "^5.59.4", 11 | "vue": "^3.0.6", 12 | "vue-router": "^4.0.4" 13 | }, 14 | "devDependencies": { 15 | "@antfu/eslint-config": "^0.4.3", 16 | "@iconify/json": "^1.1.308", 17 | "@types/codemirror": "^0.0.108", 18 | "@typescript-eslint/eslint-plugin": "^4.15.2", 19 | "@vitejs/plugin-vue": "^1.1.4", 20 | "@vue/compiler-sfc": "^3.0.6", 21 | "@vue/server-renderer": "^3.0.6", 22 | "@vueuse/motion": "^1.1.0", 23 | "cross-env": "^7.0.3", 24 | "eslint": "^7.20.0", 25 | "pnpm": "^5.18.1", 26 | "typescript": "^4.2.2", 27 | "vite": "^2.0.3", 28 | "vite-plugin-components": "^0.7.3", 29 | "vite-plugin-icons": "^0.2.4", 30 | "vite-plugin-pages": "^0.4.5", 31 | "vite-plugin-pwa": "^0.5.5", 32 | "vite-plugin-windicss": "^0.5.2", 33 | "vite-ssg": "^0.8.11" 34 | }, 35 | "eslintConfig": { 36 | "extends": "@antfu/eslint-config", 37 | "rules": { 38 | "no-unused-vars": "off", 39 | "@typescript-eslint/no-unused-vars": "off" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu/rex/68cff77ed58d85abedb6c66400a7dff80d5b7175/public/favicon.png -------------------------------------------------------------------------------- /public/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/pwa-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu/rex/68cff77ed58d85abedb6c66400a7dff80d5b7175/public/pwa-192x192.png -------------------------------------------------------------------------------- /public/pwa-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antfu/rex/68cff77ed58d85abedb6c66400a7dff80d5b7175/public/pwa-512x512.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | -------------------------------------------------------------------------------- /public/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.11, written by Peter Selinger 2001-2013 9 | 10 | 12 | 13 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/components/Editor.vue: -------------------------------------------------------------------------------- 1 | 73 | 74 |