Regular expression of the php numerical line?



  • Good time! There's such a challenge - I'm not strong in such difficult regular expressions - I want to ask for help! There is a line of approximately 19Fu2hgrskjre, which contains the numerals and the letters of the Latin, with constant consistency in one sequence: the nucleus of the digits, the aim being to divide it into four variables, in one first sequence of the figures, in the second sequence of the letters, again the numerical sequence and in the fourth respectively. I've been through the cycle foreach, but you understand this nonsense.



  • One regular expression

    preg_match('/(\d+)([^\d]+)(\d+)([^\d]+)/',"19Fu2hgrskjre",$match);
    

    In the mass $match You get your four undergrounds in the cells with $match[1] before $match[4]

    Expressed on цифры and НЕ цифры♪ If the possible letters are to be limited, the letters in the regular are to be given in a range like this. [a-zA-Z]



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2