寻求Delphi里面解析regular expression的函数!类似php或者perl里面的解析函数的样子。。。。

stanely 2004-04-28 03:19:38

类似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);
?>

或者其他什么形式的都可以。


不知道我说明白没有。。。。。。。。。。
...全文
90 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
aiirii 2004-05-05
  • 打赏
  • 举报
回复
可能你要用代理才能下
stanely 2004-05-05
  • 打赏
  • 举报
回复
咋都打不开腻?
aiirii 2004-05-05
  • 打赏
  • 举报
回复
用代理, 你會被重定向到這裹

http://regexpstudio.com/TRegExpr/TRegExpr.html

下載:
http://regexpstudio.com/Downloads/regexpr.rar
我又下了一次了, 很正常!!
stanely 2004-04-30
  • 打赏
  • 举报
回复
to angelface(§梨花带雨§) 你马上也能了
stanely 2004-04-30
  • 打赏
  • 举报
回复
to angelface(§梨花带雨§) 你马上也能了
stanely 2004-04-30
  • 打赏
  • 举报
回复
to angelface(§梨花带雨§) 你马上也能了
stanely 2004-04-30
  • 打赏
  • 举报
回复
to angelface(§梨花带雨§)
你马上也能了
angelface 2004-04-30
  • 打赏
  • 举报
回复
呀, stanely(俺是邢她汉子) 你怎么能连发四个贴?
stanely 2004-04-29
  • 打赏
  • 举报
回复
咋都打不开腻?
stanely 2004-04-29
  • 打赏
  • 举报
回复
没人知道吗?
aiirii 2004-04-29
  • 打赏
  • 举报
回复
Regular Expressions in Delphi

Copyright © 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').

aiirii 2004-04-29
  • 打赏
  • 举报
回复
http://www.latiumsoftware.com/en/articles/00009.php

TRegExpr freeware library

Want 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
stanely 2004-04-29
  • 打赏
  • 举报
回复
?
stanely 2004-04-29
  • 打赏
  • 举报
回复
?
stanely 2004-04-28
  • 打赏
  • 举报
回复
?

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧