Regular expression
Download
1 / 14

Regular Expression - PowerPoint PPT Presentation


  • 104 Views
  • Uploaded on

Regular Expression. Dr. Tran, Van Hoai Faculty of Computer Science and Engineering HCMC Uni. of Technology [email protected] Text pattern. Used for text-processing utilities Text-pattern = normal characters + metacharacters = regular expression

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Regular Expression' - fausto


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Regular expression

Regular Expression

Dr. Tran, Van Hoai

Faculty of Computer Science and Engineering HCMC Uni. of Technology

[email protected]


Text pattern
Text pattern

  • Used for text-processing utilities

  • Text-pattern = normal characters + metacharacters = regular expression

  • Metacharaters in regular expressions are different from those in file name expansion


Example 1
Example (1)

  • grep [A-Z]* script*.sh

    • means

      grep a.txt abc script1.sh script2.sh

  • grep "[a-z]*" script*.sh

    • means to find the pattern "[a-z]*" in "script*.sh"

  • Good and safe solutions are "" and ''


Metacharacter sets
Metacharacter sets

  • Depends on usage context

    • searching

    • replacing

  • Also depends on programs

  • Different engines

    • Perl

    • PHP

    • .NET regular expression library

    • Java JDK










Applications
Applications

<TAG\b[^>]*>\(.*?\)</TAG>

[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}



ad