REGEXPFIND Function: Difference between revisions

From Planfix
Jump to: navigation, search
(Created page with "{{#seo: |title=REGEXPFIND Function |titlemode=append |keywords=planfix, function, REGEXPFIND |description=REGEXPFIND Function }} The REGEXPFIND function allows you to extract the required text fragment from a variable or an infoblock. == Format == *'''REGEXPFIND('''text; pattern''')''' Arguments: *'''text''' — required, text where we search with a regular expression. *'''pattern''' — required, regular expression. == Examples == {| class="wikitable" |- ! style=...")
 
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 7: Line 7:
The REGEXPFIND function allows you to extract the required text fragment from a variable or an infoblock.
The REGEXPFIND function allows you to extract the required text fragment from a variable or an infoblock.


== Format ==
== Format ==
*'''REGEXPFIND('''text; pattern''')'''
*'''REGEXPFIND('''text; pattern''')'''


Arguments:
Arguments:
*'''text''' — required, text where we search with a regular expression.
*'''text''' — required, text where we search with a regular expression.
*'''pattern''' — required, regular expression.
*'''pattern''' — required, regular expression.


== Examples ==
== Examples ==
Line 28: Line 25:
|30000
|30000
|}
|}


== Important ==
== Important ==
*Regular expressions in Planfix are executed with the options Pattern.DOTALL and Pattern.MULTILINE. In the online [https://regex101.com/ validator] — [https://p.pfx.so/pf/nG/2iUOoF.png gms].
*Regular expressions in Planfix are executed with the options Pattern.DOTALL and Pattern.MULTILINE. In the online [https://regex101.com/ validator] — [https://p.pfx.so/pf/nG/2iUOoF.png gms].
*The first capturing group falls into the result of text processing using a regular expression. Accordingly, what needs to be in the result, you need to take in parentheses, and make the rest of the groups non-capturing (?:).
*The first capturing group falls into the result of text processing using a regular expression. Accordingly, what needs to be in the result, you need to take in parentheses, and make the rest of the groups non-capturing (?:).
*To get data from a string with quotes inside using a regular expression, you need to  
*To get data from a string with quotes inside using a regular expression, you need to [[Escaping quotes| escape]] them.
[[Quotation mark escaping|escape]] them.




== Go To ==
== Go To ==
*[[Standard functions]]
*[[Standard functions | Standard operators and Planfix functions]]
*[[Regular expression]]
*[[Regular expression]]

Latest revision as of 13:43, 28 March 2024

The REGEXPFIND function allows you to extract the required text fragment from a variable or an infoblock.

Format

  • REGEXPFIND(text; pattern)

Arguments:

  • text — required, text where we search with a regular expression.
  • pattern — required, regular expression.

Examples

Formula Description Result
REGEXPFIND("Buy 30000$"; "(\d+)") Extract a number from text using a regular expression 30000

Important

  • Regular expressions in Planfix are executed with the options Pattern.DOTALL and Pattern.MULTILINE. In the online validatorgms.
  • The first capturing group falls into the result of text processing using a regular expression. Accordingly, what needs to be in the result, you need to take in parentheses, and make the rest of the groups non-capturing (?:).
  • To get data from a string with quotes inside using a regular expression, you need to escape them.


Go To