Jump to content

PCRE expressions


fantomel

Recommended Posts

Hello guys, been a while since i posted around here. I`m trying to build a validation class and i was wondering what were the most often PCRE expressions that you use in your projects, and for what are they used?

I`m trying to make a validation class with some predefined PCRE expressions.

Link to comment
Share on other sites

There is a whole spectrum of things that I might commonly validate on. Basic things like minimum/maximum lengths (of strings, of items in a collection, etc.), character restrictions (alphanumeric, etc.) to whether a specified value (e.g. an order under) satisfies our application-specific structure, any form of user input so things like telephone numbers, credit card numbers, URLs, email addresses, date and times, and so on.

 

Also I would bear in mind that regular expressions, while a useful tool, are not a catch-all solution. You'll probably want to use "basic" string/number/etc. functions and much more complex logic all alongside some regex, as part of the validation.

Link to comment
Share on other sites

yeah i know that filter functions are awsome there is not way you can't love them and not start using them when you have everything you need right there :D.

And yes i think it's really hard to make this class work out the way it should be i need to consider many things, approaches, and existing functions not only regular expressions.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.