Jump to content

convert ereg to preg_match


qualsiasi

Recommended Posts

Hello, I tried to check preg_match syntax for be able to convert my pattern from ereg to preg_match function, but i have some problem understanding preg_match pattern building.

 

Can someone help me? The pattern i need to convert is this:

 

ereg("([0-9]{4}).([0-9]{1,2}).([0-9]{1,2})", $data[$nn], $regs)

 

its a simple date check loop, i would like to:

 

preg_match("...........................", $data[$nn], $regs)

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/167804-convert-ereg-to-preg_match/
Share on other sites

Thanks a lot rhodesa, solved.

 

@aschk: as far i had to edit a important script not wrote by me, that write sensible data on DB, where there is many of this call, i wonted to risk to do mistake by simple add basic slash, because after i saw some perl pattern example, i found it more complex and then i was not sure it was really right.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.