- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm using ippsRegExpReplace_8u() to replace matched sub strings, but didn't find a way to replace *ALL* the matched sub strings. Following is an example.
regex: [BD]
src string: ABCDE
replacement: ##
wanted dist string: A##C##E
actual dist string: A##
How to write regex and replacement to get my wanted dist string? Or IPP just doesn't support that?
What's more, even IPP only supports replacing the first occurrence of the matched sub strings, I would expect the dist string to be "A##CDE"...
Thanks,
-Evan
I'm using ippsRegExpReplace_8u() to replace matched sub strings, but didn't find a way to replace *ALL* the matched sub strings. Following is an example.
regex: [BD]
src string: ABCDE
replacement: ##
wanted dist string: A##C##E
actual dist string: A##
How to write regex and replacement to get my wanted dist string? Or IPP just doesn't support that?
What's more, even IPP only supports replacing the first occurrence of the matched sub strings, I would expect the dist string to be "A##CDE"...
Thanks,
-Evan
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
There is 'const char* pOptions' parameter in the function ippsRegExpInitAlloc. You can change search strategy by passing combination of 'i', 's', 'm', 'x', 'g' characters. By default first matched substring will be replaced. Please set in to the 'g'. 'g'is global search. That means all matched substrings will be replaced.
Igor S. Belyakov
There is 'const char* pOptions' parameter in the function ippsRegExpInitAlloc. You can change search strategy by passing combination of 'i', 's', 'm', 'x', 'g' characters. By default first matched substring will be replaced. Please set in to the 'g'. 'g'is global search. That means all matched substrings will be replaced.
Igor S. Belyakov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, it works.
-Evan
-Evan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Igor Belyakov (Intel) wrote:So please update the documentation because its othewise denoted: "All found matches are replaced according to the replacement pattern that is stored in the structure pReplaceState."Hi,
There is 'const char* pOptions' parameter in the function ippsRegExpInitAlloc. You can change search strategy by passing combination of 'i', 's', 'm', 'x', 'g' characters. By default first matched substring will be replaced. Please set in to the 'g'. 'g'is global search. That means all matched substrings will be replaced.Igor S. Belyakov
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page