0

I am new to regular expression and trying to find out what this means.

(?:(?:^KC[\\x00-\\xff]{50}))

Upon looking up online, ?: means no backtrace, I am not sure what that means? Also from ^ , does that mean a line that does not contain "KC...." for 50 character long?

tripleee
  • 175,061
  • 34
  • 275
  • 318
Tony
  • 3,319
  • 12
  • 56
  • 71

1 Answers1

2

When you use brackets () in regex, you can use references (\1..\9) to captured groups further in the regex. Example: (a|b)_\1 will match 'a_a' and 'b_b'.

?: means that the captured group won't have a number (actually, it's better to say that it won't be captured, it's just a group).

^ means negation in character classes (in []). Outside [] it means beginning of the line.

Lev Levitsky
  • 63,701
  • 20
  • 147
  • 175