Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3363

Regex capture groups

$
0
0

I am doing a migration from Sybase CEP to ESP and I have a problem with regexp_firstsearch().

 

The capture group in the following regex works in CEP but not ESP: 'eVar30=[^`]*(\d{8})-\d{8}'

 

The data has long strings that contain several individual fields concatinated together in a single string.  When it encounters this data:  blahblahblah`eVar30=Flight:FRA-BKK-FRA:20160728-20160825`blahblahblah`

 

CEP correctly returns only the match inside the parenthesis: 20160728

 

And the companion expression 'eVar30=[^`]*\d{8}-(\d{8})'  Returns: 20160825


But ESP always returns the whole matching string: eVar30=Flight:FRA-BKK-FRA:20160728-20160825

 

The capture group is a pretty basic feature of regular expressions, and this code makes a lot of use of it.  I'm not looking for a way to parse this result string to extract the desired data.  There's at least a dozen other regex expressions that are much more complicated than this one, and would be nearly impossible to parse without the capture group feature.

 

How do I get regex capture groups to work in ESP?

 

Thanks,

Dan


Viewing all articles
Browse latest Browse all 3363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>