No description
Find a file
2025-08-11 23:39:02 +08:00
COPYING Create Escape 2025-08-11 23:39:02 +08:00
go.mod Create Escape 2025-08-11 23:39:02 +08:00
go.sum Create Escape 2025-08-11 23:39:02 +08:00
main.go Create Escape 2025-08-11 23:39:02 +08:00
README.md Create Escape 2025-08-11 23:39:02 +08:00

Escape

Escape is a simple command-line utility that takes in some input, and escapes it in a way that's acceptable to a JSON parser, including escaping all backslashes by turning them into double-backslashes.

Installation

To install Escape, Golang 1.24.6 or above is required. Then, run:

go install codeberg.org/IgnisIncendio/escape@latest

Usage

Provide the string you want to escape as an argument when running the tool:

./escape "([A-Z])\w+"

This will output the following:

([A-Z])\\w+

Error Handling

If an error occurs during the marshalling process (e.g., due to invalid input), Escape will print an error message and exit with a status code of 1.

Contributors

  • 1G-N15

License

Copyright 2025 1G-N15

This file is part of Escape.

Escape is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Escape is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with Escape. If not, see https://www.gnu.org/licenses/.