Skip to content

Commit

Permalink
Merge pull request #205 from KenEucker/develop
Browse files Browse the repository at this point in the history
fix(expressions): fixes regular expressions for hint and foundLocation to include parens
  • Loading branch information
KenEucker authored Nov 25, 2023
2 parents 0053c3a + 28a03dc commit a8de55a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "biketag",
"version": "3.1.3",
"version": "3.1.5",
"description": "The Javascript client API for BikeTag Games",
"main": "./biketag.node.js",
"browser": "./biketag.js",
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 a8de55a

Please sign in to comment.