Skip to content

Commit

Permalink
Fixed regex
Browse files Browse the repository at this point in the history
  • Loading branch information
daniluk4000 committed Jan 11, 2025
1 parent 1b8b9cf commit c9f0fae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function isNumber(val: unknown, allowedAfterDot = 0): val is number {
}

export function getVACallsign(remarks: string): { callsign: string; name: string | null } | null {
const exec = /(CS|CALLSIGN)(\/| )(?<callsign>[A-Z ]+)((\/(?<name>[A-Z ]+)((?= [ A-Z]+\/[A-Z])|((?= [A-Z]+\/[A-Z]))|(?=$)))|((?= [ A-Z]+\/[A-Z]))|((?= [A-Z]+\/[A-Z]))|(?=$))/.exec(remarks);
const exec = /(CS|CALLSIGN)(\/| )(?<callsign>[A-Z ]+)(((\/(?<name>[A-Z ]+)(?= ([ A-Z]+)?\/[A-Z]))|((?= [A-Z]+\/[A-Z]))|(?=$))|((?= ([ A-Z]+)?\/[A-Z]))|((?= [A-Z]+\/[A-Z]))|(?=$))/.exec(remarks);
if (exec?.groups?.callsign) {
return {
callsign: exec.groups.callsign?.replace('VATSIMVA', '').trim(),
Expand Down

0 comments on commit c9f0fae

Please sign in to comment.