javascript - data.match(var) not working it seems -
OK, I have this small block code, which is to scanned a number on the website, but for some reason There is a hip that it is not scanning at all.
var regenges = / \ & lt; Span class = "currency-robux" data-to-"item-private-value-price" & gt; ([\ D,]) \ & LT; \ / Span \ & gt; /; Var ValueCiling = Data. Match (reggae); Value-song = number (value slicing location (",", ""));
Is there anything wrong with that?
This is related to the if
statement
if (value sling and lieutenant; = price watching) { < P> A function calls to move from there, but for some reason it does not seem to run at all. So I think the Regex
is wrong but I'm not sure how. (There is a variable in PriceWinking
, this is a snippet from the code.) On the website, I'm trying to remove it.
& lt; Span class = "robux" data-plus = "item-privatesale-price" & gt; 115 & lt; / Span & gt;
Keep in mind that item-private-value-value
changes, which is why I have set that data to capture.
You regex is usually ok, but you're incorrectly using the result. If it matches, it will result in a full string, and the match number. Not only numbers, you need a number, which is match index 1
, so you can use PriceSelling [1]
.
In addition, you also match in your edit with a duration
with class = "robux"
which is clearly different from your rampeaks if If you are interested in only data-se = "item-privatesale-price"
, you can change it to match it with a tag with that attribute.
var data = '& lt; Span class = "robux" data-plus = "item-private-value->" 115 & lt; / Span & gt; '; // matches it with a span with data-A attribute // i.e., before closing and GT; Var Regeks = / \ & lt; Span [^ & gt;] * Data-By- "Item-Private-Cost-Value" [^ & gt;] * & gt; ([\ D,] +) \ & lt; \ Span \ & gt; /; Var value = 0; Var pricing match = data Match (reggae); If (price sling match! = Null) {value sling = number (value sling match [1]. Replace (",", "")); }
Comments
Post a Comment