G
G
Gluck Virtualen2016-12-13 14:48:15
Windows
Gluck Virtualen, 2016-12-13 14:48:15

How to slip a regular expression into the WINDOW command line?

Hello
There is a FINDSTR command in the wilds of Windows .
And there is the regular expression I need (\"|\')[А-Яа-яЁ-ё\d\s]+(\"|\').
And everything would be fine, but this bad woman, when trying to run findstr with this regular expression, answers that "the system cannot find the specified path", although I do not suggest that she go anywhere. In general, nowhere, even three letters.

findstr (\"|\')[А-Яа-яЁ-ё\d\s]+(\"|\') *.php > 1.txt
Системе не удается найти указанный путь.

Moreover, this creation of a well-known manufacturer perfectly digests another regular season and does not swear:
findstr [А-Яа-яЁ-ё] *.php > 1.txt
Why doesn’t she like such and such?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2016-12-13
@saboteur_kiev

There are several regexp standards. and MS isn't particularly eager to standardize their regular expressions with the common PCRE or whatever. In the same Word, he generally has something of his own.
Therefore, read the findstr documentation and write a regular expression that it can parse.
Better yet, install git, which comes with a bunch of normally ported linux utilities, and use grep

R
res2001, 2016-12-13
@res2001

In addition to the above described regular expressions in findstr, the symbol | - service character in cmd, it cannot be used without escaping. Usually in batch files it can be escaped like this: ^|

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question