Skip to content

Commit 0a3f709

Browse files
updated regex to handle one letter suffix X123123
1 parent f13a6ef commit 0a3f709

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/hmppsintegrationapi/services/GetPersonService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class GetPersonService(
3030

3131
fun identifyHmppsId(input: String): IdentifierType {
3232
val nomsPattern = Regex("^[A-Z]\\d{4}[A-Z]{2}$")
33-
val crnPattern = Regex("^[A-Z]{2}\\d{6}$")
33+
val crnPattern = Regex("^[A-Z]{1,2}\\d{6}$")
3434

3535
return when {
3636
nomsPattern.matches(input) -> IdentifierType.NOMS

0 commit comments

Comments
 (0)