OK, I have the following regulare expression for phone number validation, but it doesn't really do EXACTLY what I want... What I want to see is a forced format 000-000-0000 where it needs to be entered with the area code-prefix-suffix including the dashes. I store it in a varchar field in mysql. What I realized today was that someone could enter 12 numbers and it would be accepted. Any direction / tweaks on this code that would make it do what I want would be greatly appreciated. Thanks Douglas if (empty($_POST["cphone"])) { $phoneErr = "Phone Number is a Requested Entry."; …

Member Avatar
Member Avatar
+0 forum 1

Is it possible to remove the suffix of URLs using the .htaccess file? For example you have [url]http://www.example.com/page.php[/url] can you change it to [url]http://www.example.com/page[/url] without the .php. I want it to work both ways, with the .php and without. Is there a way to do it with the .htaccess file? if so how? If you do it a different way how do you do it?

Member Avatar
Member Avatar
+0 forum 19

I have solved it... Shame... -------------------------------- I have problem with this code: cin >> str; smatch m; regex e("([[:w:]]+)@([[:w:]]+)\.com"); //<- Here was the error (it was regex e("([[:w:]+)@([[:w:]]+)\.com");) silly me :(( bool found = regex_search(str, m, e); cout << "m.size() " << m.size() << endl; for (int n = 0; n < m.size(); n++) cout << "m[" << n << "]: str()=" << m[n].str() << endl; cout << "m.prefix().str(): " << m.prefix().str() << endl; cout << "m.suffix().str(): " << m.suffix().str() << endl; When you input something like: <whatever>test@gmail.com<yeah> output should be: m.size() 3 m[0] = test@gmail.com m[1] = test m[2] …

Member Avatar
+0 forum 0

#include<iostream> #include<algorithm> using namespace std; #define MAX 10000000 #include<stdlib.h> #include<string.h> char s[MAX]; int p[MAX]; int bucket[MAX],nbucket[MAX]; struct suffix { int idx; }pos[MAX]; int H=0; bool cmp(struct suffix i,struct suffix j) { if(H==0) { return s[i.idx]<s[j.idx]; } else { if(bucket[i.idx]==bucket[j.idx]) { return bucket[i.idx+H]<bucket[j.idx+H]; } else { return bucket[i.idx]<bucket[j.idx]; } } } bool cmp1(struct suffix *i,struct suffix *j) { if(H==0) { if(s[i->idx]==s[j->idx]) return true; else return false; }else{ if(bucket[i->idx]==bucket[j->idx] && bucket[i->idx+H]==bucket[j->idx+H]) return true; else return false; } } int update(int l) { int id=0,start=0,c=0; for(int i=0;i<l;i++) { if(i>0 && !cmp1(&pos[i],&pos[i-1])) { id++; start=i; } if(i!=start) c=1; nbucket[pos[i].idx]=id; } memcpy(bucket,nbucket,4*l); return c; } …

Member Avatar
Member Avatar
+0 forum 11

The End.