-1

How i could match any string inside quotes if its length is higher than 10?

example:

"hi"
"hello"
"something_else"

Match just something_else, as its length is higher than 10.

I tried:

(["'])(?:(?=(\\?))\2.)*?\1

Could match anything inside the quotes, but I'm in doubt about how to set the min length.

The fourth bird
  • 154,723
  • 16
  • 55
  • 70
Cesar
  • 41
  • 2
  • 5
  • 16
  • What is the logic of the pattern? Right now the assertion checks for an optional backslash and if it is there, it matches it, which will always succeed as it is optional. Perhaps like this? `(["']).{11,}?\1` https://regex101.com/r/JHWFlM/1 – The fourth bird Oct 14 '20 at 10:00

2 Answers2

0

You can put a range of numbers (including an open-ended range) in curly braces:

".{11,}"

Matches at least 11 characters inside quotes

Joe Teague
  • 131
  • 3
0

This will do it: ".{11,}"

For a minimum length of 11, you put {11,}

See https://regex101.com/r/tgqec7/2

Christian Baumann
  • 3,188
  • 3
  • 20
  • 37