Regular match paragraphs that have begun and ended with-

clipboard.png

find a match to admin:123456@192.168.14.36/sub that begins / / ends with-
and 192.168.14.36

that begins / ends with @.

the regular expression I wrote myself always returns as false....

.
May.02,2022

/(?<=\/\/).*(?=-)/g;
/(?<=@).*(?=\/)/g;

the first / /. * -, and then add the escape character\ /. *-

the second @. * /, and then add the escape character @. *\ /

clipboard.png

after reading the rules you wrote, you got the meaning of ^ wrong. ^ means to match the beginning of a line, or what the line begins with.
you understand it as the beginning of the string to match. This is wrong

.
var str = 'rtsp://admin:123456@192.168.14.36/sub-1';
var reg = /\/\/(.+-)/;
var matches = str.match(reg);
var result = matches[1];

/\ / (. + (?: (?) /;
/\ @ (. + (?: (? =\ /) /;

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34e71-4d5ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34e71-4d5ec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?