Skip to content

Conversation

@QuickStick123
Copy link
Contributor

@QuickStick123 QuickStick123 commented Mar 12, 2023

Fixes #5221

Description of the problem being solved:

This has capture groups support.
It could likely be used to refactor ModParser(too slow https://github.com/QuickStick123/PathOfBuilding/tree/mod-parser-refactor partially working solution is like 10x slower) and applied in other places.

Steps taken to verify a working solution:

Tree: "life|mana"
image

Uniques: "increased (fire|cold|lightning) damage"
image

Anoints: "critical strike (multiplier|chance)"
image

@QuickStick123 QuickStick123 added the enhancement New feature, calculation, or mod label Mar 12, 2023
@QuickStick123 QuickStick123 changed the title Add support for regex or to tree Add support for regex or to tree and item search Mar 12, 2023
@QuickStick123 QuickStick123 changed the title Add support for regex or to tree and item search Add support for regex OR to tree and item search Mar 12, 2023
@AnnanFay
Copy link

Not necessarily a bug, but interesting how to search for terms with spaces in passive tree you need to wrap quotes around entire query.

To highlight 'increased' mana but 'more' life nodes, "increased maximum mana|more maximum life" works while "increased maximum mana"|"more maximum life" does not. Though looking at the code I'm not sure where this is coming from.

@QuickStick123
Copy link
Contributor Author

QuickStick123 commented Mar 23, 2023

The reason the former works is because it is simply evaluating the regex increased maximum mana|more maximum life which is one of those strings. Compared to the prior which gets split into three string evaluated separately "increased maximum mana" | "more maximum life" with an AND requirement. I have added a commit that allows you to now use brackets in the tree tab so you could for instance now do "(increased|more) maximum (life|mana)".

@QuickStick123 QuickStick123 force-pushed the Add-support-for-or-match branch from b5f4ad1 to ec868d0 Compare March 23, 2023 02:10
@LocalIdentity LocalIdentity merged commit 656ec6f into PathOfBuildingCommunity:dev Apr 24, 2023
@QuickStick123 QuickStick123 deleted the Add-support-for-or-match branch April 24, 2023 02:34
Dullson pushed a commit to Dullson/PathOfBuilding that referenced this pull request Dec 6, 2023
…nity#5766)

* Add support for regex or to tree

* Fix mixed white space

* Add support for item search

* Avoid evaluating invalid patterns

* Call and catch error like with tree to avoid other pattern matching crashes.

* Escape all characters expect brackets and |

* cleanup variable naming and a couple of pieces of the code

* Allow brackets in tree search

* Add support to anoint sorting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, calculation, or mod

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How do i make an "OR" search using the Search Box?

3 participants