본문 바로가기
정보기술/일반

Regular-Expressions.info

by fermi 2008. 1. 15.
Regular-Expressions.info

http://www.regular-expressions.info

A regular expression (regex or regexp for short) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*\.txt$.

But you can do much more with regular expressions. In a text editor like EditPad Pro or a specialized text processing tool like PowerGREP, you could use the regular expression \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b  to search for an email address. Any email address, to be exact. A very similar regular expression (replace the first \b with ^ and the last one with $) can be used by a programmer to check if the user entered a properly formatted email address. In just one line of code, whether that code is written in Perl, PHP, Java, a .NET language or a multitude of other languages.

'정보기술 > 일반' 카테고리의 다른 글

Hypertext Help with LaTeX  (0) 2008.01.26
2 GB DDR2 Micro-DIMM 533 MHz  (0) 2008.01.19
Vista - Open Command Prompt Here  (0) 2008.01.07
mcePhone for Skype  (0) 2008.01.05
미디어 센터의 디지털 방송 설정하기 - Step by Step  (0) 2008.01.05