1. ## Regular Expression

Am very new on this, but will ask questions to confirm what am learning

example ..

1. [abc] does this mean a or b or c, or does it mean definitely abc .. Here's an example

ez*.[ch]pp would this match anything starting with ez with an extension chpp or cpp/hpp?

that's my first question

2. Your faith that C++ people would know something -- anything -- about regular expressions is touching.

Anyway, if you wanted to match "abc", you'd just type "abc" so obviously the brackets mean something. In all regexes that I know of, [abc] means one (and exactly one) of the elements in the brackets.

3. Originally Posted by tabstop
Your faith that C++ people would know something -- anything -- about regular expressions is touching.
the brackets.
Hahah! You made have brought a smile to my face, tabstop.

4. Oh, and you can google "regular expressions" and find just all sorts of tutorials etc.

5. Originally Posted by master5001
Hahah! You made have brought a smile to my face, tabstop.
He's very touchy with his touching remarks, am touched! ...

Here's the next one, i just made this up so could be completely out of the way

Code:
"^(0[1234])+1[\s]([\d]{3}[\s]([\d]{4})\$"

// I aim to match a number such as "011 234 5678"

011 = ^(0[1234])+1   // can also be 021/031/041

234 = [\s]([\d]{3}     // notice a space infront

5678 = [\s]([\d]{4})\$

6. Originally Posted by tabstop
Oh, and you can google "regular expressions" and find just all sorts of tutorials etc.
Yes, but then one needs a bit of a test after reading!!!

7. The 0[1234] can be repeated, so 01011 234 5678 also matches. If that's what you want, then hey.

Edit: And upon re-review, I think you're missing a parenthesis that I automatically fixed when I read it.

8. Moved to Tech as this is better suited for RegEx stuff

9. Code:
[\s]([\d]{4})\$
There's no need to surround single characters (or escape sequences) with square brackets; this does exactly the same thing.
Code:
\s(\d{4})\$
(Although I think the curly-brace-repetition is not part of the POSIX regular expression standard. It may be part of extended POSIX regex, though, and it's definitely in Perl.)