• home
  • forum
  • my
  • kt
  • download
  • Testing Regular Expression Match Patterns

    Author: 2007-08-11 13:35:43 From:

    Regular expression started in Perl language. But it is now used everywhere: text editors, programming languages, and software testing tools. Regular expression is powerful, but hard to learn. This page allows you to learn and test regular expression with your own strings, match patterns, sub patterns, and modifiers.

    What is a regular expression?

    A regular expression is a string of normal and meta characters that can be evaluated as a match pattern. The best reference guide on regular expression is the Perl manual called "perlre". You can easily find and download a copy of "perlre" on the Web.

    For example, "/^(http:\/\/)?[^\/]+/i" is a regular expression that represents a pattern to match the base URL of any Web page URL.

    How to test regular expression

    To help you learn and test regular expression match patterns, FYIcenter.com has designed this online testing page using the PHP preg_match() funtion:

    • preg_match(pattern, subject, matches) - Returns the number of times the pattern matches in the subject.

    All you need to do is to enter the pattern string and the subject string in the form below and click the Start button. Remember that the pattern string must include "/" as delimiters.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Ad Management (4)
      Calendars (3)
      Chat Systems (7)
      Content Management (6)
      Cookies and Sessions (8)
      Counters (8)
      Database Related (8)
      Date and Time (9)
      Development (6)
      Discussion Boards (7)
      E Commerce (6)
      Email Systems (9)
      Error Handling (5)
      File Manipulation (10)
      Flash and PHP (4)
      Form Processing (7)
      Guestbooks (8)
      Image Manipulation (3)
      Installing PHP (5)
      Introduction to PHP (9)
      Link Indexing (6)
      Mailing List Management (8)
      Miscellaneous (10)
      Networking (6)
      News Publishing (6)
      OOP (8)
      PEAR (6)
      PHP vs Other Languages (2)
      Polls and Voting (5)
      Postcards (0)
      Randomizing (8)
      Redirection (8)
      Searching (6)
      Security (6)
      Site Navigation (7)
      User Authentication (10)
      WAP and WML (7)
      Web Fetching (0)
      Web Traffic Analysis (11)
      XML and PHP (0)

    New

    Hot