类似php里面的<?php
// Returns true if "abc" is found anywhere in $string.
ereg ("abc", $string);            // Returns true if "abc" is found at the beginning of $string.
ereg ("^abc", $string);// Returns true if "abc" is found at the end of $string.
ereg ("abc$", $string);// Returns true if client browser is Netscape 2, 3 or MSIE 3.
eregi ("(ozilla.[23]|MSIE.3)", $HTTP_USER_AGENT);  // Places three space separated words into $regs[1], $regs[2] and $regs[3].
ereg ("([[:alnum:]]+) ([[:alnum:]]+) ([[:alnum:]]+)", $string,$regs); // Put a <br /> tag at the beginning of $string.
$string = ereg_replace ("^", "<br />", $string); 
 
// Put a <br /> tag at the end of $string.
$string = ereg_replace ("$", "<br />", $string); // Get rid of any newline characters in $string.
$string = ereg_replace ("\n", "", $string);
?>或者其他什么形式的都可以。
不知道我说明白没有。

解决方案 »

  1.   

    http://www.latiumsoftware.com/en/articles/00009.phpTRegExpr freeware libraryWant to implement regular expressions in your Delphi applications? A good way to do it is using the TRegExpr library, which is freeware and comes with full source code and is documented in many languages. This library was developed by Andrey V. Sorokin porting the C code from the well-known Henry Spencer's V8-routines (a subset of Perl Regular Expressions) to Object Pascal. The last version of the library is 0.942 and you can get it from "AnSo @ Web" (Sorokin's web site) at:
    AnSo @ Web
    http://anso.da.ru/
    http://anso.virtualave.net/ TRegExpr library
    http://anso.virtualave.net/regexpr.zip (~284 Kb) Help files: (42-55 Kb)Russian: http://anso.virtualave.net/RegExpRu.zip 
    English: http://anso.virtualave.net/RegExpE.zip 
    Bulgarian: http://anso.virtualave.net/regexpbg.zip 
    German: http://anso.virtualave.net/RegExpG.zip 
    French: http://anso.virtualave.net/RegExpF.zip 
    Spanish: http://anso.virtualave.net/RegExpS.zip 
      

  2.   

    Regular Expressions in DelphiCopyright &copy; 2000 Ernesto De Spirito What are regular expressions?Regular Expressions are a way to search and replace patters of text. In a way, these patterns are like using the wildcards '?' and '*' when searching for files, but regular expressions are immensely more powerful than that. In the pattern you can specify whether the string being sought should occur at the beginning or end of the line, which characters are allowed, how many times they can be repeated and many more things.What are they used for?Basically, they are used for three purposes:Powerful text search (and replace)
    You can use regular expressions for example to search for a specified record in a database in a much more powerful way than using the SQL LIKE operator.Data validation
    With Regular Expressions you can validate user input to check whether it follows a given format that due to its complexity and variability cannot be checked with masks. For example, you can check whether a string starts optionally with a plus or minus sign, then a sequence of no more than seven digits and optionally a point followed by up to two digits.Data extraction
    Not only you can check whether a string follows a certain pattern, but you can extract arbitrary parts of the text. For example, for a phone number like '+1 (123) 555-9999' you can extract the country code ('1'), area code ('123') and the local number ('555-9999').
      

  3.   

    呀, stanely(俺是邢她汉子)  你怎么能连发四个贴?
      

  4.   

    to angelface(§梨花带雨§) 
    你马上也能了
      

  5.   

    to angelface(§梨花带雨§) 你马上也能了
      

  6.   

    to angelface(§梨花带雨§) 你马上也能了
      

  7.   

    to angelface(§梨花带雨§) 你马上也能了
      

  8.   

    用代理, 你會被重定向到這裹http://regexpstudio.com/TRegExpr/TRegExpr.html下載:
      http://regexpstudio.com/Downloads/regexpr.rar
    我又下了一次了, 很正常!!