Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Looking for someone to make a regexp for me

General discussions related to php

Moderators: macek, egami, gesf

Looking for someone to make a regexp for me

Postby billygoatkaraoke » Mon May 28, 2012 9:48 pm

Hi

I'm happy to pay someone that can write me a regexp that does the following.

Allows:
' - single quotes
& - ampersands
- single space

any letters or digits in any language eg acompáñame

It has to fit into the filter_var I have below, which returns true if a match on an illegal character is found (the regexp I have in there isn't working how I want):

if(filter_var($myWords, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/^[' &\p{L}\p{Nd}]*$/"))) === false) return true;

I will need to test it to make sure it works for what I need, and will need you to rework the regexp if it doesn't.

Payment would be via Paypal.

Thanks guys
billygoatkaraoke
New php-forum User
New php-forum User
 
Posts: 91
Joined: Sat Aug 13, 2011 7:20 pm

Re: Looking for someone to make a regexp for me

Postby ejsexton82 » Tue Jun 05, 2012 10:51 am

It might be easier to create a regex by filtering illegal characters. A regex like this should allow any character except for exclamation marks (!) and question marks (?):

Code: Select all
$regex = '/^[^!\\?]*$/';


The ^ symbol inside of the [] brackets negates the character set, so that it matches any character except the ones listed.
User avatar
ejsexton82
New php-forum User
New php-forum User
 
Posts: 86
Joined: Mon Jun 04, 2012 10:05 pm
Location: Ankara, Turkey


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron