I am trying to understand the regular expression given below:
"/login?(\\?.+)?"
I have gone through the Java docs, but I am not able to clearly understand the purpose of this expression.
I understand that it looks for a string that starts with /login
, then after that what does the characters ?(\\?.+)?
represent?
Please help me in understanding this.
It optionally matches literal text ?some-text-here
after /login
. Also /login?
makes last n
optional:
It matches following inputs:
/logi
/login
/logi?something
/login?something
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With