Need some RegEx wisdom here. I have a bunch of regular expressions in my desktop app that I am porting over to an iOS app. In the desktop, these all work great. They also work great in Kem’s RegExRx application. I generally take the text I am scanning and put that in RegExRx and build the expression there until I get what I want. I then copy and paste the code. It works great.
On the iOS side of things, I am using Jason King’s JKRegEx classes. But everything is failing. Not getting any matches. I’ve talked to Jason and he says perhaps it’s a difference between the ICU engine that iOS uses and the PCRE engine that the desktop uses. I’m not an expert, so I thought I’d post here and see if anyone can tell what I am doing wrong. So here is an example expression and the text I am parsing. Please don’t make fun of my expressions!
Text Being Searched:
Mon, 03 Feb 2020 15:55:57 -0500
27483045 214164 u-boot_c.bin
4060803258 3155808 uuImage
1044641709 13946880 initrd2m
Now this is one example. I am trying to pull out the “B2.0.3” in this case. But I want to pull anything after it as well until I get to the new line and the forward slash. This value is a firmware version of a product. Sometimes there is text after the last digit that is part of the firmware build so I want to capture that as well.
On desktop and in RegExRX, this is capture 100% of the time. In iOS with Jason’s classes, it fails.
I have worked backwards in iOS, and I have success up to the .*? part of the expression. So:
Works fine. Captures the B2.0.3 but wouldn’t capture any text after it. So something breaks here and I don’t know what. And this is just one expression. I’ve probably got 10 or 15 more that also aren’t working.
I’m kinda stuck on this so any help would be much appreciated…