Find a regular expression for the master

Updated on technology 2024-04-19
3 answers
  1. Anonymous users2024-02-08

    It's more convenient for you to use the regular rule for the situation here, ** it's all written for you, let's take it.

    For the convenience of testing, I directly wrote the content in **. When you read the contents of a file, you use the file get contents($filename) function to read all the contents directly. If you don't know, check the manual.

    The content is modified with reference to $mail, which is definitely easy to do.

    Address: !!address!!!

    Contents: !!content!!!

    eof;mail1 = test. eof;

    search = array('!!!name!!!','!!!address!!!','!!!phone!!!','!!!content!!!');

    replace = explode("",trim($mail1));

    str = str_replace($search,$replace,$mail);

    var_dump($str);

    Anyway, you first copy the ** I sent out into a php file, run it and see the result. You can usually write a simple ** like this first, run it and then slowly add it.

    When you use it, change it to this:

    mail = file_get_contents('');

    search = array('!!!name!!!','!!!address!!!','!!!phone!!!','!!!content!!!');

    replace = explode("",trim($_session['mail'This assumes that you have already read into the session.

    str = str_replace($search,$replace,$mail);This is the result you want.

    var_dump($str);Print the results for easy observation.

  2. Anonymous users2024-02-07

    It should be fine, if only the corresponding entry above is extracted:

    For example: Extract regular:

    Name: S+(S+).

    Address: S+( S+).

    Contents: s+( s.*)

    Or if you have a more detailed need, then I can write more about the regularization above.

  3. Anonymous users2024-02-06

    I don't need to talk about anything else.

Related questions
7 answers2024-04-19

Hello, although I haven't studied PHP, but in order to help you (and your 100 points) also take a little look, here are my opinions. Please forgive me if it is not right. >>>More

8 answers2024-04-19

ab\w[xyui]c

ab is constant. >>>More

7 answers2024-04-19

It's not equal, and there doesn't seem to be such a thing as twice as much as AS. >>>More

7 answers2024-04-19

string s = "Beijing Tiananmen Square to the Great Hall of the People to the east, at the second intersection to the east"; >>>More

2 answers2024-04-19

/our-price\">\u00a5 (./span>/'

unnnn means "the character in unicode with hexadecimal nnn". >>>More