Newsroom Update

New features come to Apple services this fall. Learn more >

iphone Apple Numbers RegEx g and m flags? to get price within multilines from Shortcut Extract Text from Image

is following implemented for iphone Apple Numbers?

  • g: Global flag. Find all matches in the string, not just the first one.
  • m: Multiline flag. Use ^ and $ to match the start and end of a line, rather than the start and end of the whole string.

I need help to Write a regular expression to match prices within lines with possibly empty lines in between as follows

  1. a line of date, then
  2. a line of text
  3. a line of text
  4. price to be matched
  5. a line of text

Thanks ahead!


iPhone XR, iOS 17

Posted on May 22, 2024 2:52 AM

Reply
1 reply

May 22, 2024 3:42 AM in response to SunnyInToronto

is following implemented for iphone Apple Numbers?

  • g: Global flag. Find all matches in the string, not just the first one.
  • m: Multiline flag. Use ^ and $ to match the start and end of a line, rather than the start and end of the whole string.

I need help to Write a regular expression to match prices within lines with possibly empty lines in between as follows

  1. a line of date, then
  2. a line of text
  3. a line of text
  4. price to be matched
  5. a line of text

Thanks ahead!


Otherwise I will add another Table for formula to strip LF. While this additional Helper Table lower Regex skill requirement to extract from multi-lines but it is much less legible due to loss of LFs and adds maintenance of another table template to be copied for future sheet.

iphone Apple Numbers RegEx g and m flags? to get price within multilines from Shortcut Extract Text from Image

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.