Skip to main content

Timeline for Apex Replace String

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Jul 14, 2021 at 9:08 answer added Mariia Illarionova timeline score: 0
Jul 14, 2021 at 8:31 history edited Zhang Ou CC BY-SA 4.0
deleted 43 characters in body
Nov 10, 2020 at 2:49 comment added Zhang Ou ** Pattern regex = Pattern.compile('[0-9]'); Matcher regexMatcher = regex.matcher('(1 OR 2) AND 3'); while (regexMatcher.find() == true) { System.debug(LoggingLevel.INFO, '***' + regexMatcher.group()); } ** Through your tips, I did this step. Still stuck on the replacement, can you give me an example?
Nov 9, 2020 at 10:15 comment added Phil W I agree with Keith C but would ask why you are doing it this way? And if you do continue this way, I recommend you use regex matching for the numeric placeholders to ensure you consider "word break" characters otherwise you might have false matches (e.g. "1" might falsely match the "10" in "(10 OR 9) AND (8 OR 7)...")
Nov 9, 2020 at 9:56 comment added Keith C Yes you can parse JSON and build strings in Apex. Keep going - just needs a bit of time investing. And if you are at all familiar with unit tests, I recommended using unit tests to provide your logic is working as you add to it.
Nov 9, 2020 at 9:03 history asked Zhang Ou CC BY-SA 4.0