Open lucian-cm opened 7 years ago
👍 I think it's nice to improve the regex
(however this is know issue -- the regex is not used to extract data just to detect whether get_sp is used -- the eval is pure python, false positives are admissible at this stage; it means we put the function in context but don't use it)
check regex under
Regex
class that is wrong wrong regexget_sp\\(\\s*'([\\w\\-.]+)'\\s*,\\s*(.+?)\\)
For test string _getsp('11.a', 'a)') the groups are 0: [0,18] get_sp('11.a', 'a) 1: [8,12] 11.a 2: [15,17] 'a
proposed solution
get_sp\\(\\s*'([\\w\\-.]+)'\\s*,\\s*(.+)\\)
0: [0,20] get_sp('11.a', 'a)') 1: [8,12] 11.a 2: [15,19] 'a)'
Same thing needs to be checked for both single quotes and double quotes