Home php TRADE OFFER LINK

TRADE OFFER LINK

Author

Date

Category

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";

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions