SID-02257: Regex searches in UserList search box
| Status: |
Asked |
TWiki version: |
6.0.2 |
Perl version: |
5.10.1 |
| Category: |
CategorySearch |
Server OS: |
CentOS 6.8, kernel 2.6.32 |
Last update: |
9 years ago |
How can I do regex searches in the Main.
UserList topic? I have looked at the
UserReports code and the type of search seems to be set up as regex but I have not been able to do searches with a simple regular expression pattern like !A for example.
--
TWiki Guest - 2016-10-06
Discussion and Answer
Can you provide an example of what you're trying to do? I don't know if the search parameter within
%USERREPORTS% supports regex however you can perform a search of users using a regex search like:
%SEARCH{"META:FORM.*[U]serForm;META:FIELD.*[F]irstName.*Hank" web="%USERSWEB%" type="regex" nonoise="on" format="| $topic |" excludetopic="TWiki*"}%
The search string is made up of:
META:FORM.*[U]serForm Finds all topics containing a FORM called
UserForm (this should identify all topics that are users)
META:FIELD.*[F]irst Name.*Hank Finds a field called First Name that contains the word Hank on the same line. You will want to modify this to be specific to whatever you're searching for.
; The search string is separated by a semi-colon which is a TWiki specific operator as per
RegularExpression
Hope this helps
--
Jani Hamalainen - 2016-10-11
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.