andgineer / TRegExpr

Regular expressions (regex), pascal.
https://regex.sorokin.engineer/en/latest/
MIT License
174 stars 63 forks source link

TRegExpr compile: unknown meta-character: \R (pos 10) #286

Closed Uefi1 closed 1 year ago

Uefi1 commented 2 years ago

Hello i need to use \R in my regex but i get error unknown meta-character: \R how can i fix this ?

Alexey-T commented 2 years ago

What is \R character? Docs tells about it?

Uefi1 commented 2 years ago

\R matches any Unicode newline sequence !

Alexey-T commented 2 years ago

Docs tells about it? no! it is not supported.

Alexey-T commented 2 years ago

It is not documented in other engines too: https://www.regular-expressions.info/refcharclass.html what engine supports it?

Uefi1 commented 2 years ago

I don't know that they wrote me a regular expression where \R is present in notepad++ works

Uefi1 commented 2 years ago

I Found this in documentation: https://www.regular-expressions.info/refcharacters.html

Alexey-T commented 2 years ago
\R Matches any line break, including CRLF as a pair, CR only, LF only, form feed, vertical tab, and any Unicode line break

supported in Java 8 and Perl 5.10. good idea to add it. maybe later will add it.

Uefi1 commented 2 years ago

\R Matches any line break, including CRLF as a pair, CR only, LF only, form feed, vertical tab, and any Unicode line break supported in Java 8 and Perl 5.10. good idea to add it. maybe later will add it.

Можно пока чем либо попробовать заменить эту \R ?

Alexey-T commented 2 years ago

use English.

Uefi1 commented 2 years ago

use English.

Sorry, I thought you were a Russian Serb or Ukrainian) Can you try to replace this \R with something for now?

Alexey-T commented 2 years ago

(\r\n|\r|\n|\v .....) must work.

Uefi1 commented 2 years ago

(\r\n|\r|\n|\v .....) must work.

Exactly how did you write it? ([a-z]+\ )|.+\R+ ([a-z]+\ )|.+(\r\n|\r|\n|\v .....)+

Alexey-T commented 2 years ago

I mean by dots ..... that your must list all EOL chars or char-pairs

\r\n \r \n \v others

Uefi1 commented 2 years ago

([a-z]+\ )|.+(\r\n|\r|\n|\v[a-z])+ ??

Alexey-T commented 1 year ago

@user4martin Do you think it's a good idea? No wish to work on it? https://github.com/andgineer/TRegExpr/issues/286#issuecomment-1253966374

User4martin commented 1 year ago

Good idea, but I haven't got any immediate available time.

Alexey-T commented 1 year ago

\R is added. In my fork, let's test it please. https://github.com/Alexey-T/TRegExpr If all ok, I will do the PR.

\R inside char class [] is not yet supported. it is not supported at regex101 site. in the 50-70% of engines.

r

@User4martin @Uefi1