Hi, it must be an easy to solve problem i hope

what is the regular expression for the pattern:

G|xxxx - a capital letter | arbitrary word

I used the patterns below but they failed:

Qt Code:
  1. rule.pattern = QRegExp("\\b([A-Z])\\|([a-z])\\s");
  2.  
  3. or
  4.  
  5. rule.pattern = QRegExp("\\b([A-Z])|([a-z])\\s");
To copy to clipboard, switch view to plain text mode 

the thing is i have no idea how to express vertical bar in this case.
anyone can help?

ps: i find the documentation from QRegExp is somehow not clearly explain all the cases.
is there any better tutorials for that?