Skip to content

Commit

Permalink
fix(expressions): fixes regular expressions for hint and foundLocatio…
Browse files Browse the repository at this point in the history
…n to include parens

~ solution provided by Parth and Tim ~

closes #204
  • Loading branch information
KenEucker committed Nov 25, 2023
1 parent b1e7edc commit b3cc5df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const runTests = async (out = false) => {
// await queueTagAsync("Imgur", bikeTagImgurInstance, out)
// await getQueueAsync("Imgur", bikeTagImgurInstance, out)
// await getCurrentTagAsync("Imgur", bikeTagImgurInstance, out)
// await get10TagsAsync("Imgur", bikeTagImgurInstance, out)
await get10TagsAsync("Imgur", bikeTagImgurInstance, out)
// await get10PlayersAsync("Imgur", bikeTagImgurInstance, out)
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/expressions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getPlayerFromTextRegex = new RegExp(
)

export const getFoundLocationFromTextRegex = new RegExp(
/(?:is\s*(at|the)?\s*\(?)(.+?)(?:\)|]|$)|(?:found\s*(at)?\s*\(?)(.+?)(?:\)|])|(?:found\s*at\s*\()(.+?)(?:\))|(?:\[(?:\s*bike\s*)(?:\s*tag\s*))#?(\d+)(?:(?:\])|(?:\s*.\s*(.*)\]))/im
/(?:is\s*(at|the)?\s*\(?)(.*)(?:\)|]|$)|(?:found\s*(at)?\s*\(?)(.*)(?:\)|])|(?:found\s*at\s*\()(.*)(?:\))|(?:\[(?:\s*bike\s*)(?:\s*tag\s*))#?(\d+)(?:(?:\])|(?:\s*.\s*(.*)\]))/im
)

export const getConfirmedBoundaryFromTextRegex = new RegExp(
Expand All @@ -25,7 +25,7 @@ export const getGameFromInfoFromTextRegex = new RegExp(

export const getGameSlugFromTextRegex = new RegExp(/((\w*)\s*bike\s*tag!?)/i)

export const getHintFromTextRegex = new RegExp(/(?:hint:\s*?)([^)]*)/i)
export const getHintFromTextRegex = new RegExp(/(?:hint:\s*)(.*)\)/i)

export const getGPSLocationFromTextRegex = new RegExp(
/(([0-9]{1,2})[:|°]([0-9]{1,2})[:|'|′]?([0-9]{1,2}(?:\.[0-9]+){0,1})?["|″]([N|S]),?\s*([0-9]{1,3})[:|°]([0-9]{1,2})[:|'|′]?([0-9]{1,2}(?:\.[0-9]+){0,1})?["|″]([E|W]))|((-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?))/
Expand Down

0 comments on commit b3cc5df

Please sign in to comment.