Skip to content

Instantly share code, notes, and snippets.

@I3rixon
Last active February 11, 2025 15:25
Show Gist options
  • Save I3rixon/cce2a592bd47392ade09d90b9b4f2b39 to your computer and use it in GitHub Desktop.
Save I3rixon/cce2a592bd47392ade09d90b9b4f2b39 to your computer and use it in GitHub Desktop.
UA callsigns search on webpage via Console
// regex for Ukrainian callsigns, including EM and EO
const callsignPattern = /(U[R-Z]|E[M-O])\d+[A-Z]{1,4}/g;
// Get the text content of the entire page
const pageContent = document.documentElement.innerText;
// Find all matches of the pattern
const matches = pageContent.match(callsignPattern);
// Filter for unique matches
const uniqueMatches = matches ? [...new Set(matches)] : [];
// Display the results
if (uniqueMatches.length > 0) {
console.log(`Found ${uniqueMatches.length} unique callsign(s):`);
console.log(uniqueMatches);
} else {
console.log("No Ukrainian callsigns found on this page.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment