Welcome, Guest. Please login or register.

Author Topic: What's the problem with parenthesis containing filenames?  (Read 1843 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: What's the problem with parenthesis containing filenames?
« on: August 03, 2006, 05:59:16 PM »
I guess you are not familiar with amigados wildcard syntax?

The following are reserved for pattern matching:

( ) [ ] ~ | # ? % `

Here's what they do

? matches any single character. so a? matches all 2-letter words beginning with a.

# matches zero or more copies of whatever follows it, so b#a matches b, ba, baa, and so on.

() groups expressions together - useful in combination with | and ~

~ negates the meaning of whatever follows it. Hence ~(#?.info) matches everything which doesn't end in .info

| represents an either/or choice. e.g. foo.(txt|doc) will match both foo.txt and foo.doc

[] defines a letter range. e.g. [a-d].txt will match a.txt, b.txt, c.txt and d.txt,

% matches the null (empty) string. Never really found much use for this one :-)

` escapes the next character if it is any of the above wildcards. You'd need this for your brackets to suppress their wildcard meaning.

The most common combination wildcard is #? means any quantity of anything, i.e. everything!
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: What's the problem with parenthesis containing filenames?
« Reply #1 on: August 03, 2006, 06:07:31 PM »
Quote

AmigaMance wrote:
Quote
I guess you are not familiar with amigados wildcard syntax?

 Wrong guess.


Then you should know (see earlier post) that brackets are used by the wildcard system and need to be escaped if you are using them in filenames, which of course you shouldn't because they are reserved for the wildcard system :-P
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: What's the problem with parenthesis containing filenames?
« Reply #2 on: August 03, 2006, 06:25:18 PM »
If you think amigados wildcards are harsh, you'd love RegEx syntax :-D
int p; // A