Reply to Thread
Results 1 to 4 of 4

Thread: Regular Expressions support in all (or almost) search boxes!? AWESOME!!!

  1. #1
    Recruit
    Join Date
    Aug 2016
    Posts
    6
    World
    Zeus

    Lightbulb Regular Expressions support in all (or almost) search boxes!? AWESOME!!!

    Hello, I'm really impressed with the finding and really really couldn't find any reference of it being supported in the game, so I'm sharing this here!

    Seems that any search box in the game supports full regex support!!! While this is something maybe 99% of the players are not aware of, this is a really really useful feature for managing trade office or ordinary direct trade between players.

    I will show here some examples of regular expressions that may be useful for people in the everyday, you don't need to know the inner regex workings to use them at all. Simple syntax already helps a lot!

    For example, say you want to sell skunks for coins in trade office. There's few common characters to make both coins and skunks show in the same filter screen. Also, the last filter used is preserved between offer and cost sides. So while in the offer side, you filter for this:

    Code:
    skunk|coins
    Then both will show up in the screen without scrolling being needed -- provided you don't have much stuff (like adventures) matching any of the patterns above. If you happen to have, you can fine tune it more, knowing the skunk item is "Drill Sergeant Skunk", you can just, quickly:

    Code:
    ^drill|^coins
    or group the words

    Code:
    ^(drill|coins)
    And have both on screen. Same is useful when you want to ask tricks for fish, or more commonly and throughout the year, steaks for fish. This might be enough:

    Code:
    ^(stea|fis)
    Usually no much fancy needed:

    Code:
    stea|fis
    Should just do it!

    Another useful search is if you want to filter by "Add content to deposit: <number> <something>". Where <number> is the amount you or the seller have made available in Trade Office and <something> is what that is. With the regular expression below, you can filter, for example, iron ore refills excluding the unnecessary extracted iron ore:

    Code:
    ^add .* iron
    The circumflex is not really necessary, it just says that the match must begin with that, it matches begin of item name in our case!..

    Now, let's fancy something more complex. Say you want to browse refills of gold ore, and you are very rich, so it is only useful for you refills with 1000 or more units in it. Yes, that's possible with renowned regex!!! Here's the pattern to search:

    Code:
    ^add .* [0-9]{4,} gold
    It will match "add" as the initial item name, then anything until it finds a sequence of 4 or more digits (0-9) followed by the "gold" word.

    Find deposits for iron or coal? Now I don't care about the amount.

    Code:
    ^add .* (iron|coal)
    I could combine this with the gold pattern above, if you are wondering. Just replace the gold part with (item1|item2|...|itemN).

    This is a very useful feature that for obvious reasons (the audience is not supposed nor expected to know regex to play the game!) but a really reaally impressive feature to be implemented, I just by chance found, and no googling around nor forum search gave anything about it.

    I would like the opportunity to cumpliment the BlueByte team for implementing search this way, and I hope this thread now helps players take advantage of this feature that's probably in the game since its conception!

    The only thing I couldn't really find is, in Trade Office, if I could filter items by their offer/cost status, in other words, if I want to find only refills being sold, or refills being offered, I can't specify it with regexp as far as I could find out! So clicking the offer/cost columns to sort the results is still the only choice.

    Hope this helps people with their game experience!!! If anybody knows of anything detailing regex implementation on SO with some additional tricks & treats (in reference of current hallowen event! heh), please don't hesitate on sharing!
    Last edited by AvengerX; 10-27-16 at 09:30 am. Reason: fix a(nother couple) code tag(s) :P

  2. #2
    Mayor Perwyn's Avatar
    Join Date
    Feb 2012
    Location
    The Shire
    Posts
    1,559
    World
    Zeus
    Thanks for sharing this! Most people are not aware of it, so good for you.
    "Very little is needed to make a happy life; it is all within yourself, in your way of thinking." ~ Marcus Aurelius

  3. #3
    Recruit
    Join Date
    Aug 2016
    Posts
    6
    World
    Zeus
    Thambletochen (sorry if I mistype the username!) found me online and told me about a topic which discussed this (with no regexp reference though), so very useful, as I suspected, already discussed, but just didn't have the "regexp" word within! :P

    Trade options, search for sellers or buyers only or both

  4. #4
    Noble
    Join Date
    Jul 2013
    Posts
    364
    World
    Ares
    Cool! Didn't know about this feature either. I asked my coding buddy and the glare of disappointment in his eyes was depressing (me not knowing). He told me I am not to post anything about coding on this forums for a month... :P
    [11:48] davivo: I don't know why you pick on the Nords so much, they're such nice friendly folk looking for a place to raise their kids
    [11:50] aZr4el: not my fault that they carry lots of xp around and wont part with it unless you take it from their dead bodies

Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts