Last active
February 11, 2025 15:25
-
-
Save I3rixon/cce2a592bd47392ade09d90b9b4f2b39 to your computer and use it in GitHub Desktop.
UA callsigns search on webpage via Console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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