giorgos
giorgos

Reputation: 1841

Find repetition with regex

I would like to catch with regex any repetition of these three characters . / -

For example I would like to find:

"a//fsdf"
"a/-fd"
"v.-"

But not this one:

"a/f.d-qwe"

Upvotes: 0

Views: 80

Answers (2)

Starfish
Starfish

Reputation: 3574

You mean like this one? :

[\.\/\-]{2,}

Here are the test results

Upvotes: 1

hjpotter92
hjpotter92

Reputation: 80639

Use curly braces, to specify the amount of repetition:

[./-]{2,}

This will match the string of characters with length exceeding 2.

Upvotes: 0

Related Questions