https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

Patrick Jackson

04/21/2019, 12:52 AM
I recently found that regex on multiplatfrom appears to be use the platforms regex engine, which can mean you will need different expressions for each platform. At least this is the case for JS, JVM, & iOS. Any plans to implement a common regex engine?
🤔 1
d

Dominaezzz

04/21/2019, 9:07 AM
Do you have any examples of this?
g

gildor

04/21/2019, 9:18 AM
K/N has own regex implementation that should be compatible with Java regex, if it’s not true better to create an issue
in general it’s valid concern, JS implementation may be not fully compatible, but I think it’s not so bad tradeoff, no need to bundle implementation to JVM and JS. But it requires covering every regexp by common tests to be sure that it works properly in every platform
p

Patrick Jackson

04/22/2019, 1:42 PM
Yes, an example is matching alphanumeric including unicode chars. In JVM this works "[^\p{Alnum}]" but fails on native and JS. If I have time I will put up a test project
g

gildor

04/22/2019, 4:20 PM
Probably make sense to report for K/N