-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow regex usage for setAlias function #287
Comments
+1 |
I have attached a image as a example. |
Thanks for the very useful feature! A replacement similar to your example works perfect. But how does this "beast" work? Matching groups? Perl regex? A simple substitution is easier to understand: |
Hmm... I'm not sure if I got your question. Are you asking for a "search and replace" function? If so, this will not do it, since it uses a simple Go Regex, where it do a search using a regular expression and will replace the item.name with the result of the search (the same way any online regex tester will do, where you use a test string and it shows you the 'ouput' of you search). |
I'm not sure, which regex engine is used. The regex shown in your screenshot is not golang, it is pcre. Even it is not Go re2. Lookahead and lookbehind are not supported in re2 (re2 Syntax). It is strange that positive lookahead works, but positive lookbehind does not. |
hmm, strange, I was almost sure that it was golang regex, since I used the same function that is invoked by the text filter on text metrics. Maybe @alexanderzobnin could answer this. |
This code executes on client side. So it should be JavaScript regex. |
With current implementation it's quite problematic to get some text between two words (e.g.: "steal" from "CPU steal time"), as JS don't support positive lookbehind like this: Matching group would be much simpler approach: So let's make the match group number configurable? |
Yea, I should make alias functions more flexible. |
I'm submitting a ...
Would be nice if a regex could be used to set the alias, eg when a regex is used to select the items.
The text was updated successfully, but these errors were encountered: