Skip to content

Commit fcb6311

Browse files
committed
Updated README
1 parent fb11e57 commit fcb6311

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

README.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,41 @@
55

66
### Installation
77

8-
You can download the [latest release as a PHAR](https://github.com/s9e/RegexpBuilderCommand/releases/latest/download/build-regexp.phar), or install the command as a [Composer](https://getcomposer.org/download/) dependency:
8+
There are two ways to use this command. You can download the [latest release as a PHAR](https://github.com/s9e/RegexpBuilderCommand/releases/latest/download/build-regexp.phar):
9+
```
10+
$ wget -q https://github.com/s9e/RegexpBuilderCommand/releases/latest/download/build-regexp.phar
11+
$ chmod +x build-regexp.phar
12+
$ ./build-regexp.phar --version
13+
build-regexp 0.4.3
14+
```
915

10-
```bash
11-
composer require s9e/regexp-builder-command
16+
Or you can install the command as a [Composer](https://getcomposer.org/download/) dependency:
17+
18+
```
19+
$ composer -q require s9e/regexp-builder-command
20+
$ vendor/bin/build-regexp --version
21+
build-regexp 0.4.3
1222
```
1323

1424

1525
### Usage
1626

1727
Strings can be specified either directly in the command invocation or via an input file. The following shell example shows how to pass them in the command invocation as a space-separated list:
1828
```
19-
$ ./vendor/bin/build-regexp foo bar baz
29+
$ ./build-regexp.phar foo bar baz
2030
(?:ba[rz]|foo)
2131
```
2232

2333
In the following example, we create a file with each value on its own line, then we pass the name of the file via the `infile` option:
2434
```
2535
$ echo -e "one\ntwo\nthree" > strings.txt
26-
$ ./vendor/bin/build-regexp --infile strings.txt
36+
$ ./build-regexp.phar --infile strings.txt
2737
(?:one|t(?:hree|wo))
2838
```
2939

3040
By default, the result is output in the terminal directly. Alternatively, it can be saved to a file specified via the `outfile` option. In the following example, we save the result to a `out.txt` file before checking its content:
3141
```
32-
$ ./vendor/bin/build-regexp --outfile out.txt foo bar baz
42+
$ ./build-regexp.phar --outfile out.txt foo bar baz
3343
$ cat out.txt
3444
(?:ba[rz]|foo)
3545
```
@@ -46,16 +56,16 @@ Several presets are available to generate regexps for different engines. They de
4656

4757
The following examples show the results of a few different presets with the Unicode characters U+1F601 and U+1F602 as input.
4858
```
49-
$ ./vendor/bin/build-regexp --preset pcre "😁" "😂"
59+
$ ./build-regexp.phar --preset pcre "😁" "😂"
5060
\xF0\x9F\x98[\x81\x82]
5161
52-
$ ./vendor/bin/build-regexp --preset javascript "😁" "😂"
62+
$ ./build-regexp.phar --preset javascript "😁" "😂"
5363
\uD83D[\uDE01\uDE02]
5464
55-
$ ./vendor/bin/build-regexp --preset pcre --flags u "😁" "😂"
65+
$ ./build-regexp.phar --preset pcre --flags u "😁" "😂"
5666
[\x{1F601}\x{1F602}]
5767
58-
$ ./vendor/bin/build-regexp --preset javascript --flags u "😁" "😂"
68+
$ ./build-regexp.phar --preset javascript --flags u "😁" "😂"
5969
[\u{1F601}\u{1F602}]
6070
```
6171

0 commit comments

Comments
 (0)