Trying to check the correctness of Steam Trade Offer Link which has the kind of
https://steamcommunity.com/tradeoffer/New/?partner=200396688& ;Token=XSVAH09R
(in this case it is my link)
Checking on JS and PHP, I try to try on JS:
var EXPR = new regExp (/ http (?: s): //steamcommunity.com/tradeoffer/New/? Partner = ([0-9] +) & amp; token = ([a-za-z] +) /;
Expr.Test ("https://steamcommunity.com/tradeoffer/new/?partner=200396688& ;token=xsvAH09R");
but writes
syntaxerror: nothing to repeat
p.s to whom it is not difficult, help still make a regular expression on PHP, I have tight
Answer 1, Authority 100%
The regular expression should be corrected as follows
var expr = /http (?:s): \/ \/steamcommunity.com \/tradeoffer \/newi// \? partner = ([0-9] +) & amp; token = ([a-za-z0-9] +) /;
Expr.Test ("https://steamcommunity.com/tradeoffer/new/?partner=200396688& ;token=xsvAH09R");
PHP
& lt;? php
$ Pattern = "/ ^Htttp[SMUnity.com \/steamcommunity.com \/tradeOffer \/new \/UPartner=([0-9 +) )& ;Token=([a-za-z0 -9] +) $ / ";
$ url = "https://steamcommunity.com/tradeoffer/new/?partner=200396688& ;token=xsvah09r";
if (preg_match ($ Pattern, $ URL)) Echo "Validen";