On 2007-03-19 18:18,
ma***********@gmail.com wrote:
Hi!
I have the following regular expression, that matches any word with
number and letter:
[[:alnum:]]+-?[[:alnum:]/@\\.#&]*'?
Now I must modify it so that also the word with a "_" inside are
accepted. For example:
As_for
From_now_on
For_example
Can you help me?
Thanks in advance.
This is really off-topic here, since there are no regex in (the current)
C++ standard, you should ask these kinds of questions in a forum for the
library you used for regexes. Having said that I think you can get it to
do what you want with one of the following (I'm no expert at regex and I
don't recognize the flavour so I give no guarantees):
[[:alnum:]]+(-|_)?[[:alnum:]/@\\.#&]*'?
[[:alnum:]]+[-_]?[[:alnum:]/@\\.#&]*'?
--
Erik Wikström