Skip to content

Find Elements using Regex #159

Discussion options

You must be logged in to vote

After thinking of it I feel like I decided to decline the feature request because:

  • we currently support all valid css selectors and should stick to them, regex is not
    Common to select / Travers an html tree.
  • css selector syntax allows a lot in that direction already such as attribute value selectors and pseudoclasses
  • the kotlin streaming api is so powerful and nice to use that I think it's cleaner to just let the user filter a selection by matching a regex or not on its own e. G.
aListOfDocElement.filter { it.toCssSeletor.matches("some regex".toRegex() } 

What I can imagine is to provide a helper function that is doing the filtering

EDIT:
to catch multiple elements at the same time or b…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by christian-draeger
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
feature request New feature or request question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #135 on June 29, 2021 21:01.