I have a conditional regular expression that works on regex test websites, such as regexlib.com, but cannot get it to work in my Java application.
But, http://www.regular-expressions.info/conditional.html indicates that Java doesn't support conditionals, but I've seen other posts on SO imply that it does.
An example of my RegEx is: (?(?=^[0-9])(317866?)|[a-zA-Z0-9]{6}(317866?))
It should match either of these inputs: 317866
or 317866A12
or FCF1CS317866
How do I work around this Java limitation?
TIA
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…