I have to match words longer than 30 characters, but these words can't be urls.
I tried to do this, but doesn't work fine:
(?<!ftp)([^\s\t\r\n<>]{30})
I have a few points:
ftp://example.com
because you are using a lookbehind, which sees nothing before the first f. Use a lookahead instead.{31,}
.Try this instead:
(?<![^\s<>])(?!ftp)([^\s<>]{31,})(?![^\s<>])