I get a string which size is 16 (location of chess pieces on the mini-chess-board). This string may contain only symbols:
- K (king)
- P (pawn)
- N(knight)
- R(rook)
- B(bishop)
- Q (queen)
- and whitespaces (free field).
How can i validate this string with regex to check if string size is really 16, symbols are only of these and also it should necessarily contain one K symbol (because one King should be)
I tried [KQBNRP ]{16} but now cant check for a K symbol
Thank you