• Home
  • Blog
  • Projects
    • QWcrm
    • Joomla
      • mod_helloworld
      • plg_helloworld
      • QWRealURL
  • KB
    • Articles
    • Links
  • Forum
  • Stuff
    • Links
  • Search
  • Login
QuantumWarp QuantumWarp QuantumWarp
  • Home
  • Blog
  • Projects
    • QWcrm
    • Joomla
      • mod_helloworld
      • plg_helloworld
      • QWRealURL
  • KB
    • Articles
    • Links
  • Forum
  • Stuff
    • Links
  • Search
  • Home >
  • KB >
  • Links >
  • Programming >
  • PHP >
  • Articles >
  • Snippets >
  • preg_match() >
  • What do the symbols mean in preg_match? - Stack Overflow
Plusnet - Header Banner

What do the symbols mean in preg_match? - Stack Overflow

I have this expression in a code snippet i borrowed offline. It forces the new users to have a password that not only requires upper+lower+numbers but they must be in that order! If i enter lower+upper+numbers, it fails!

if (preg_match("/^.*(?=.{4,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $pw_clean, $matches)) {

Ive searched online but can't find a resource that tells me what some characters mean. I can see that the pattern is preg_match("/some expression/",yourstring,your match).

What do these mean?

1.  ^          -  ???
2.  .*         -  ???
3.  (?=.{4,})  -  requires 4 characters minimum
4.  (?.*[0-9]) -  requires it to have numbers
5.  (?=.*[a-z])-  requires it to have lowercase
6.  (?=.*[A-Z])-  requires it to have uppercase
7.  .*$        -  ???

Listing Details

http://stackoverflow.com/questions/10201337/what-do-the-symbols-mean-in-preg-match
Website
stackoverflow.com/questions/10201337/what-do-the-symbols-mea...
Visited
67

Legal

  • Attribution
  • DMCA
  • Privacy & Cookies
  • Terms & Conditions

Resources

  • Feedback
  • Downloads
  • Typography

QuantumWarp

  • About
  • Contact

Follow Us

  • GitHub
© QuantumWarp 2020, Powered by Astroid. Developed by QuantumWarp