Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

regex syntax javafx

A silly question, I am not sure what is wrong in the following javafx regex syntax. Netbeans complains illegal escape character in whole of this regex string,

var pattern:String = "(\/S*)(ftp|http|https):\/\/(\w+:\{0,1\}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?";

Any help is greatly appreciated. Thanks a bunch.

Cheers, Abi

like image 598
Abhishek Avatar asked Jul 08 '26 20:07

Abhishek


1 Answers

Try this double \\ for \

var pattern:String = "(\\/S*)(ftp|http|https):\\/\\/(\\w+:\{0,1\}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\-\\/]))?";

like image 110
AabinGunz Avatar answered Jul 10 '26 10:07

AabinGunz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!