G
G
GDApsy2013-10-18 23:01:05
Regular Expressions
GDApsy, 2013-10-18 23:01:05

A regular that checks that a string consists of pairs of identical letters (they may differ in case)

That is, for example, the line: AaBb is correct, but the lines: AaBv and AaBbc are not.
As I understand it, you need to use backref here, but somehow it turns out stupidity, and not what you need

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
sheknitrtch, 2013-10-19
@GDApsy

I got the following regex:

((\w)\2)*

The 'Case insensitive' flag must be set. You can test the regular expression at regexpal.com , debuggex.com or Regular Expression Tester

K
Kron0S, 2013-10-19
@Kron0S

^(?:(\w)\1)+$

G
GDApsy, 2013-10-19
@GDApsy

Thank you!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question