1. I have corrected the e-mail settings so that outgoing e-mails from these forums should be sent now. If you tried to Register or Reset your Password, please try again!
    Dismiss Notice

The Trouble with Brackets

Discussion in 'Census: EverQuest II' started by Feldon, Jan 8, 2021.

  1. Feldon

    Feldon Administrator Staff Member

    So a Census user ran into a problem with trying to search for a term surrounded by square brackets. Specifically this query:

    https://census.daybreakgames.com/json/get/eq2/marketplace_item/?category=[PR]

    The returned results always behaved as if this were a RegEx search for all items containing "PR" in the name in capital letters or lowercase. It seems that Census rejects an initial open bracket ([) no matter what. A few of us in the EQ2Wire Discord chat tried different things, but it was theFoof who figured out that a period (.) character could be used as wildcard character to get around Census not accepting the initial bracket. These queries work:

    https://census.daybreakgames.com/xm...tegory=^.PR.&c:show=name,category&c:limit=100

    Bifu further determined that the right bracket can still be used as otherwise the query above would match anything with "pr" as the 2nd and 3rd characters. This only matches items in a category starting with any character, PR, and then a closing brace:

    https://census.daybreakgames.com/xml/get/eq2/marketplace_item/?category=^.PR]&c:show=name,category&c:limit=100
     
    • Informative Informative x 1
  2. Caam

    Caam Member

    If the category is being treated as a regular expression, you should be able to "escape" the brackets with a backslash to make it a literal search character. The character sequence would be "\[PR\]". Since you can't put a backslash on a querystring as-is, you'll have to replace it with %2F to pass it in properly. In theory, anyway.
     
  3. Feldon

    Feldon Administrator Staff Member

    Census threw an invalid syntax every time we tried that.
     

Share This Page