Tags:
create new tag
view all tags

SID-02522: Regex search: lookaheads

Status: Asked Asked TWiki version: 6.1.0 Perl version: 5.038002 (linux)
Category: CategoryApplications Server OS: Linux 6.1.0 Last update: 2 months ago

I am trying to read the content of a single-column table with regex search ( type="regex" multiple="on" ). The column looks like this:

|*Name*|

|Work|

|Private|

|Organisation|

|Partner|

|Other|

Search pattern .*\|.*?\|.* works fine, as does \|.*?\|, but the results include the "|" starting and ending the table column. Therefore I tried to use regex lookups, but I can't get it working. I tried:

.*?(?<=\|).*?(?=\|).*

.*?(?<=(\|)).*?(?=(\|)).*

(?<=(\|)).*?(?=(\|))

and many others, but all without any result. Can someone explain how to use lookups in regex SEARCH?

Additionally, I want to exclude the column header with the *Name*.

Search pattern (?<=^\|)[^\*].*?(?=\|) works fine in regex101.com, but not in TWiki, nor does pattern (?<=^\|)[!\*].*?(?=\|) (with an exclamation mark for the negotiation).

What am I doing wrong?

-- Emiel Van Riel - 2025-10-27

Discussion and Answer

I am not clear on what you want to achieve. Could you provide an example of input, and expected search output?

-- Peter Thoeny - 2025-11-24

      Change status to:
ALERT! 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.
SupportForm
Status Asked
Title Regex search: lookaheads
SupportCategory CategoryApplications
TWiki version 6.1.0
Server OS Linux 6.1.0
Web server Apache
Perl version 5.038002 (linux)
Browser & version Firefox 144.0
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2025-11-24 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.