Skip to content

Commit

Permalink
Fix A-Trust: Codes starting with letter
Browse files Browse the repository at this point in the history
Codes starting with letter were broken

A negative lookahead for something that looks like a space-seperated otp 
code starting with a letter was added
  • Loading branch information
mkg20001 committed Oct 28, 2023
1 parent 44110ab commit 6ef0e63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CodeExtractor {

private val ignoredWords = listOf("مقدار", "مبلغ", "amount", "برای", "-ارز")
private val generalCodeMatcher =
"""(?:${sensitiveWords.joinToString("|")})(?:\s*(?!${
"""(?:${sensitiveWords.joinToString("|")})(?:\s*(?![a-zA-Z0-9] [a-zA-Z0-9] [a-zA-Z0-9] [a-zA-Z0-9] )(?!${
ignoredWords.joinToString("|")
})[^\s:.'"\d\u0660-\u0669\u06F0-\u06F9])*[:.]?\s*(["']?)(?!${
ignoredWords.joinToString(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ www.iranketab.ir
Vergleichswert
v 7 n M Z S S H 6 l
TAN
4 u 8 k u f
a u 8 k u f
Bitte überprüfen Sie alle Werte!
(5 Min. gültig)"""
assertEquals(false, CodeIgnore.shouldIgnore(msg))
assertEquals("4u8kuf", CodeExtractor.getCode(msg))
assertEquals("au8kuf", CodeExtractor.getCode(msg))
}
}

0 comments on commit 6ef0e63

Please sign in to comment.