Searching with REGEXPR
The iSphere Project for and RDi 9.5.1.3+
Brought to you by:
f_hildebrandt,
tools400
I am having trouble getting a search to return results. When I use this regular expression over source I know has this pattern, I either get results not correct or no results.
I need to find RPGLE members with internal output specs that have a print record with no line spacing.
This is a production source example that does not match, O EF PRTHDR 0
This pattern returns results that I don't want .....O.{37}(0|\s)0 and not the ones I want.
This pattern does not return any results, ^.....O.{37}(0|\s)0.
I have tried reducing the columns to search to 1-46 but this has no effect.
This pattern works in finding *INKx strings, \*INK[A-NPR-Y].
This is a sample source that should demonstrate issue.
Hi Matt,
You stumbled about a nasty problem. The regex function available on the IBM i does not follow the well-know expression most people now. Some character classes are different, because regex on the IBM i follows the "Posix/Unix" specification as stated by IBM support.
One of the nasty differences is that
\s(white spaces) must be expressed as[[:space:]].I described that in the iSphere help: iSphere > Reference > Stream File Search
The question mark (?) next to the "Regular expression" label on the "iSphere Source File Search" dialog is a link that takes you to the regex help page.
On my opinion, the following expressions should be best:
At least it returns the expected result:
Thank you for the example source. That is how I like it.
Thomas.
Last edit: Thomas Raddatz 2024-09-20
Ugg, of course I would forget about that. Normally, I use VSCode but it does not have a search using reg expressions over IBM i members.
Thanks for the reminder.
Hi Matt,
No problem at all, you are welcome.
As long as I remember the details, everything is fine. Just kidding.
Thomas
Last edit: Thomas Raddatz 2024-09-21