| View previous topic :: View next topic |
| Author |
Message |
kalled Guest
|
Posted: Tue Jan 25, 2005 1:50 pm Post subject: |
|
|
Actually I don't like being a "Me too" poster, but since using PERL I could not think about programming without RegExps, so maybe a poll or something like that might tell how many think like me.
Or is an implementation already on its way?
Thanks a lot for Your good work!
Kalle |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Tue Jan 25, 2005 2:09 pm Post subject: |
|
|
Regular expressions are planned. One problem with them is that most open source implementations seem to be quite large, and thus might increase the size of compiled scripts by too much.
I was considering recently whether simple wildcards would be a good first step toward RegEx. For example, the wildcards * and ? seem to cover about 80% of the benefit of RegEx (in terms of common usage). If those wildcards could be implemented as a TitleMatchMode and for string searching such as IfInString/StringGetPos, it might satisfy a lot of users, even those who don't know (and perhaps don't want to learn) regular expressions.
As someone familiar with RegEx, perhaps you can list the top five or so RegEx features that you use (in addition to . and .*, which are roughly equivalent to ? and * in the file system, as well as apps such as MS Excel).
Anyone else who is a heavy user of RegEx, please feel free to do the same. This discussion may help limit the scope of RegEx implementation, and thus allow me to get it done sooner.
Thanks. |
|
| Back to top |
|
 |
Atomhrt
Joined: 02 Sep 2004 Posts: 128 Location: Sunnyvale
|
Posted: Wed Jan 26, 2005 12:09 am Post subject: |
|
|
So, would your proposed * wildcard method allow us to match these two files:
filename-01252005.txt
filename-2-01252005.txt
If I used a wildcard string such as: filename*01*.txt or f*01*2005*.txt ? _________________ I am he of whom he speaks! |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Wed Jan 26, 2005 12:23 am Post subject: |
|
|
| Yes, I think those examples would both work. It seems best to have * stand for any string of 0 or more characters, and ? stand for exactly one character. |
|
| Back to top |
|
 |
Atomhrt
Joined: 02 Sep 2004 Posts: 128 Location: Sunnyvale
|
Posted: Wed Jan 26, 2005 12:29 am Post subject: |
|
|
| Chris wrote: | | Yes, I think those examples would both work. It seems best to have * stand for any string of 0 or more characters, and ? stand for exactly one character. |
Coooool.  _________________ I am he of whom he speaks! |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 206
|
Posted: Wed Jan 26, 2005 6:09 pm Post subject: |
|
|
| In that case you should also do range wildcards, like [A-Z] or [a,b,c,d] or the like. That's the last major component of basic shell wildcards. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Jan 26, 2005 6:32 pm Post subject: |
|
|
[Aa-Zz,0-9] or [a,b,e-i]  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Jan 27, 2005 4:18 am Post subject: |
|
|
| Thanks. That would keep the scope pretty narrow, while hopefully supporting the majority of RegEx needs. |
|
| Back to top |
|
 |
|