php - Regex with the following conditions -


I am trying to understand how regex works by matching a regex to the following conditions:

  1. The string must start with one or more alphanumeric characters.
  2. The string should be followed by the '@' sign
  3. After the string 'asa' immediately after the string '@'
  4. string in a string Or more of 0 and / or 1
  5. string must be followed other string
  6. after string
  7. I'm around Phase 4 and now I'm stuck, collecting one or more special characters and / or numbers, no letters

  8. 'abc' was thinking that E person may offer some tips:

      $ pattern = "/ ^ [a-zA-Z0- 9 @] + @ + [Asaa] + [01] /"; $ Theme = "abcB123Ccac @ asa01"; Echo preg_match ($ pattern, $ theme)? 'Match': 'no match';  

You can try regex below.

  ^ [azza-j 0-9] + asa [01] + @ [^ azza-jade] + ac $  

The code will be,

  $ pattern = "~ ^ [a-za-z0-9] + @ asa [01] + @ [^ a-za-z] + abc $ ~"; $ Theme = "abcB123Ccac @ asa01"; Echo preg_match ($ pattern, $ theme)? 'Match': 'no match';  
  1. The string must start with one or more alphanumeric characters.

      ^ [A-Za-z0-9] +  
  2. followed the string followed by a '@' sign Should be

      @  
  3. string '@'

      asa  
  4. +

  5. String must be followed by a string containing one or more special characters and / or any other @

      @ < / Code> 
  6. numbers, letters (except letters)

      [^ a-za-z] +  
  7. ABC '' ABC ''

      ABC $  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -