14.1. Regular expressions-tutorial

发布时间 : 2025-10-25 13:33:21 UTC      

Page Views: 9 views

A regular expression (Regular Expression) is a text pattern that includes normal characters (for example, letters between an and z) and special characters (called metacharacters).

Regular expressions use a single string to describe and match a series of strings that match a syntactic rule.

Regular expression is tedious, but it is powerful, and the application after learning will not only improve your efficiency, but also give you an absolute sense of achievement. As long as you read this tutorial carefully and make some reference when applying it, it is not a problem to master regular expressions.

Many programming languages support string manipulation using regular expressions.

现在开始学习正则表达式!

14.1.1. Example

The following example finds a number from the string str:

14.1.2. Example

Extract the contents of the numeric portion from the string str (match once):

varstr="abc123def";varpatt1= /[0-9]+/;document.write(str.match(patt1)); 

The text of the following tag is the obtained matching expression:

123 

尝试一下 »

14.1.3. Testing tool

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。