How to replace all named groups with a special word? or remove them?

20 views
Skip to first unread message

Hassan Monfared

unread,
May 11, 2013, 3:30:25 PM5/11/13
to re2...@googlegroups.com
I have a rewritten URL like : http://localhost/category/23/seach_kw/foo and I want to replace 23 and foo with '_' character. and what I need is :
My problem is that RE2::Replace method requires rewrite argument which I don't have it.

RE2 rx("http://localhost/category/(?P<CAT_ID>\\d+)/search_kw/(?P<SEARCH_KW>\\w+)");
RE2::Replace(&s,rx,?????????????);

I'm not also sure if unnamed group may help me or not.
Is there any approach ?
Appreciate your help.
Hassan

Reply all
Reply to author
Forward
0 new messages