C#的regular expression

請問C#的regular expression點filter走:
||
|*|

Thanks

There is no "C#的regular expression." RE is not language dependent.
If you don't know RE, just keep things simple and use the string functions.

TOP

Thanks, problem solved

TOP

原帖由 無忌 於 2008-10-23 13:14 發表
There is no "C#的regular expression." RE is not language dependent.
If you don't know RE, just keep things simple and use the string functions.


I agree that Regexp is language independent, but it is quite implement dependent, so you can see some minor different when you use Regexp in sed, awk or perl.

TOP

原帖由 little_keung 於 2008-10-23 06:09 PM 發表
I agree that Regexp is language independent, but it is quite implement dependent, so you can see some minor different when you use Regexp in sed, awk or perl.


In programming, there is always a clear line between "what you do" and "how you do." The question in the thread is really about the RE syntax, not how to use RE in C#. Beginners often couple "what they do" with a certain language and that's a bad habit. That's why I brought it up.
As a matter of fact, if regular expression is "quite implement dependent", nothing is not.

TOP

A side-issue to bring up.  In most implementations, RE's pattern matching is implemented by "backtracking".  To improve performance, especially on long inputs, we should write the pattern in a more specific matter so that the search tree can be smaller.

TOP