D
D
Dmitry Korolev2018-08-02 12:23:21
Regular Expressions
Dmitry Korolev, 2018-08-02 12:23:21

What is the error in the expression?

I write a regular expression and it does not find matches

Regex.IsMatch(s, @"^(
                                                    ([#№\p{Sc}]?\d+[%\p{Sc}]?)
                                                |
                                                    (\p{P}?\s*)
                                                |
                                                    (\w+)
                                                )$", RegexOptions.Singleline)

I submit in turn such lines
12
space
ert
, space
erw12
everything shows it didn’t fit, but I think that only the last one should not fit
, what was wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick Sdk, 2018-08-02
@adressmoeistranici

and what about the huge spaces and carries in the regex example?
look at this result
is it supposed to be like this?
https://regex101.com/r/npoITO/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question