I have a column in a DataFrame scala, that contain many string like this:
[Z12M1E][AGORA][Essai][CS_RES]ECO-56417-Escalade-ECO-56344-#incidentMajProduit# Y2103 Y2103B0 S82NE INCIDENTE 20180305 030403 20180305 030512
[Z12M1E][AGORA][Essai]ECO-56417-Escalade-ECO-56344-#incidentMajProduit# Y2103 Y2103B0 S82NE INCIDENTE [CS_RES] 20180305 030403 20180305 030512
[Z12M1E][AGORA][20180305]ECO-56417--ECO-56344-#incidentMajProduit# Y2103 Y2103B0 S82NE INCIDENTE Escalade 20180305 030512
[Z12M1E][AGORA][20180305]ECO-56417--ECO-56344-#incidentMajProduit# Y2103 Y2103B0 S82NE INCIDENTE [CS_RES] Escalade 20180305 030512
I would like compute the number of line that contain the string [CS_RES]
, for exemple in my dataframe, the number of the line contain the string [CS_RES]
is 3
.
How can I do it using Regex ?