Splunk Search

Regular expression for international characters

mahbs
Path Finder

Hi,

I've written a regular expression to capture international characters, the only trouble I'm having with it now is setting the limit on the length of the character.

This is what I have:

[^\p{""}$]{0,3}

I've been using the following site to validate it:
https://www.regextester.com/21

Please help!

Tags (1)
0 Karma

elliotproebstel
Champion

Adapting to SPL from this post:
https://stackoverflow.com/questions/24143150/regex-help-for-alphanumeric-and-international-character...

I think this should work:

| stats count 
| eval tf="Baum -$&*( 5 Steine hoch groß 3 Stück grün****" 
| rex field=tf max_match=0 "(?<int_chars>(\p{L}))"
0 Karma

elliotproebstel
Champion

Just to be clear: the first two lines just set up some dummy data. The only part you'd really need is the regex:
"(?<int_chars>(\p{L}))"

0 Karma

skoelpin
SplunkTrust
SplunkTrust

You should provide some sample data to test this against

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...