Tags:
create new tag
, view all tags

Question

I'm looking for a search with regex, which returns a list of all topics starting with a certain string and ending with "one uppercase letter and indefinitely lowercase letters but no more uppercase letter". I.e. "[A-Z][a-z]+$".

However, the appropriate regex search does not yeald the expected results:

%SEARCH{"^Host[A-Z][a-z]+$" regex="on" casesensitive="on" scope="topic" nosummary="on" noheader="on" nosearch="on" nototal="on" format="[[$topic]], "}%

returns an empty list. Whereas

%SEARCH{"^Host[A-Z][a-z]+" regex="on" casesensitive="on" scope="topic" nosummary="on" noheader="on" nosearch="on" nototal="on" format="[[$topic]], "}%

results in "HostAri, HostAriLog, HostAriConfig, HostCyber, HostCyberConfig, HostCyberLog, ".

What I want is "HostAri, HostCyber, ". How can I achieve that? .

  • TWiki version: 01 Dec 2001
  • Web server: Apache 1.3.22 - 1.7.1
  • Server OS: RedHat Linux 7.1
  • Web browser: Netscape 7.73f for Solaris
  • Client OS: Solaris 2.6.1

-- FrankThommen - 04 Jun 2002

Answer

For some reason "$" does not work to identify the end of the string. Use "^Host[A-Z][a-z]+[^A-Z0-9]" instead.

-- PeterThoeny - 04 Jun 2002

Thank you, but I tried all of the following regexps

  • "^Host[A-Z][a-z]+[^A-Z0-9]"
  • "^Host[A-Z][a-z]+[^A-Z0-9]*"
  • "^Host[A-Z][^A-Z0-9]+"

I still get the HostSomething and the HostSomethingAndSomethingMoreWithCapitalLetters topics instead of only getting the HostSomething topics.

What else can I try?

-- FrankThommen - 05 Jun 2002

You are right, this does not work. The "not" part in the regex does not apply if there is no required text after that. It looks like you need to search for some text in the topic that appears only in your HostSomething topics, but not in HostSomethingElse topics.

-- PeterThoeny - 05 Jun 2002

Therefore I change this question into a bug notice smile

-- FrankThommen - 06 Jun 2002

Is fixed, see Codev.CantAnchorSearchREToEnd

-- PeterThoeny - 15 Jul 2002

Topic revision: r6 - 2002-07-16 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.