Afif JABBADO
asked on
javascirp regex to match a element has specefic url
let say in the body element i have lot of a href i want to match <a> element
<a between there is a lot of attribute originalsrc=\"http://127.0.0.1:8080/?rid=6yQMvKA"
i want to match the first url from originalsrc that have ?rid !
and extract only first occurrence ..
Array [ "<a href=\"https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%3A8080%2F%3Frid%3D6yQMvKA&data=02%7C01%7C%7C709e51d24145423f067708d7f11af976%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637242970459564695&sdata=Pcn03oTi%2B1w6TaqSOGr4WTkqMGUPgb%2BwvsBLCNHyafc%3D&reserved=0\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"Verified\" originalsrc=\"http://127.0.0.1:8080/?rid=6yQMvKA\" shash=\"kMreJEmsTtxFS9f7nF X5cQPqcvA2 TBL0FMyGan 0Nl6aLRiK/ ue6Fx9QoIJ avzhRzUBZN 90yMTHMklj J2bAuCqoHY scPId+ uMEVm6v9z9 8Dp0aTujsp L8QpiN9Y1k tNjg5yZ9aq rDS718NIq3 gXrqUIUP6M c8m7ytQ/uF SGShLTQ=\" style=\"text-decoration:no ne\"></a>" ]
i want to get the originalsrc only if it contain ?rid=
<a between there is a lot of attribute originalsrc=\"http://127.0.0.1:8080/?rid=6yQMvKA"
i want to match the first url from originalsrc that have ?rid !
and extract only first occurrence ..
Array [ "<a href=\"https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2F127.0.0.1%3A8080%2F%3Frid%3D6yQMvKA&data=02%7C01%7C%7C709e51d24145423f067708d7f11af976%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637242970459564695&sdata=Pcn03oTi%2B1w6TaqSOGr4WTkqMGUPgb%2BwvsBLCNHyafc%3D&reserved=0\" target=\"_blank\" rel=\"noopener noreferrer\" data-auth=\"Verified\" originalsrc=\"http://127.0.0.1:8080/?rid=6yQMvKA\" shash=\"kMreJEmsTtxFS9f7nF
i want to get the originalsrc only if it contain ?rid=
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.