Edit part of Javascript plugin

Trying to edit the below javascript so that instead if setting this.origMovement.x and this.origMovement.y to just this.x and this.y, respectively, I want it so that it sets them to values set inside of a comment of the event. For example <x,y>. where x and y would be numbers of your choice.

Is this possible at all?

Game_Event.prototype.setDetectStuff = function() {
this._detectBalloon = 0;
var page = this.page();
this._blockLos = false;
if (page) {
for (var i = 0; i < page.list.length; i++) {
if (page.list.code == 108 && page.list.parameters[0].contains("<block_los>")) {
this._blockLos = true;
break;
};
};
this._origMovement._moveSpeed = page.moveSpeed;
this._origMovement._moveFrequency = page.moveFrequency;
this._origMovement._direction = this._direction;
this._origMovement.x = this.x;
this._origMovement.y = this.y;
};
};
I recommend wrapping your code in code tags
Code:
[code]
// Your code here
[ /code] <-- Remove extra space here

Right now the code you have is messed up as parts of it has been interpreted as BBCode.
My apologies, added code again below in code tags. Thanks for the tip!

Code:
Game_Event.prototype.setDetectStuff = function() {
this._detectBalloon = 0;
var page = this.page();
this._blockLos = false;
if (page) {
for (var i = 0; i < page.list.length; i++) {
if (page.list.code == 108 && page.list.parameters[0].contains("<block_los>")) {
this._blockLos = true;
break;
};
};
this._origMovement._moveSpeed = page.moveSpeed;
this._origMovement._moveFrequency = page.moveFrequency;
this._origMovement._direction = this._direction;
this._origMovement.x = this.x;
this._origMovement.y = this.y;
};
};

Also, should probably add this is a part from the plugin here: https://galvs-scripts.com/2016/08/01/mv-event-detectors/

Basically want the event to return to a specified x y instead of its start x y as it resets/changes when the event is teleported. I think that by changing the code as above it may fix the issue.
does javascript support regular expressions?
if so, shouldn't be hard.

set it to look for "<(numeric),(numeric)>" or "tag = [(n),(n)]" like it is set to look for "block_los"
Ok that makes sense I think. At the moment I have the following. How do I make it so it searches for numbers in tags as below without knowing what the numbers are? As it just says (n) is not defined. Then how would I grab these values to set them below?

Code:
            if (page.list[i].code == 108 && page.list[i].parameters[0].contains("<" + (n) + "," + (n) + ">")) {
                this._origMovement.x = n;
                this._origMovement.y = n;
                break;
            }
How do I make it so it searches for numbers in tags as below without knowing what the numbers are?

that is precisely what I'm asking.
that's the core function you need to use, with that structure.
answer that, and you'll solve the problem.
Got it to work.

Code:
        for (var i = 0; i < page.list.length; i++) {
            if (page.list[i].code == 108 && page.list[i].parameters[0].contains("<post:")) {
                var myRegex = /<post:(\d+),(\d+)>/;
                var matches = page.list[i].parameters[0].match(myRegex);
                this._origMovement.x = matches[1];   //the first number
                this._origMovement.y = matches[2];   //the second number
                break;
            }
        };

Original thread: https://forums.rpgmakerweb.com/threads/edit-part-of-javascript-plugin.84188/