Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
wlakom authored Dec 25, 2024
1 parent 92fbc00 commit f481d3f
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,36 +175,6 @@ $scope.parseData = function(data) {
};


function matchPattern(name, pattern) {
// Remove the static "sector:name=" part from the pattern
pattern = pattern.replace("sector:name=", "");

// Checking if the length of the name and the pattern are the same
if (name.length !== pattern.length) {
return false;
}

// Loop through each character to check for matches
for (let i = 0; i < name.length; i++) {
if (pattern[i] !== 'N' && name[i] !== pattern[i]) {
return false;
}
}

return true;
}

// Example usage
const name = "Fuchs";
const pattern = "sector:name=N";
const result = matchPattern(name, pattern);

if (result) {
console.log(`The name "${name}" matches the pattern "${pattern}"`);
} else {
console.log(`The name "${name}" does not match the pattern "${pattern}"`);
}

function matchPattern(name, pattern) {
console.log("Original pattern:", pattern);
// Remove the static "sector:name=" part from the pattern
Expand Down

0 comments on commit f481d3f

Please sign in to comment.