Software Venture Consulting
ToMarket

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Brian Dunning
Contact me | vCard


Brian on CNN
Brian on CNN


Brian on CBS Radio


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 FileMaker Pro Custom Functions

Search  |  List  |  Show Random  |  Upload  |  Add This to Your Site

BetweenNext ( text ; searchString1 ; occurrence1 ; include1_1 ; search

Fabrice Nordmann, BH&A
http://www.bh-a.com

extracts the middle of a text in between delimiters, based on search strings and an occurrence numbers

Sample Input:
BetweenNext ( "A 1234567890 X B 1234567890 X C 1234567890 X" ; "B" ; 1 ; 1 ; "X" ; 1 ; 0 )
Sample Output:
"B 1234567890 "


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

if you have myFMbutler's Clip Manager installed

Description:

/*
BetweenNext ( text ; searchString1 ; occurrence1 ; include1_1 ; searchString2 ; occurrence2 ; include2_1 )

by Fabrice Nordmann, BH&A
v.1.1, Feb 2008
returns empty if searchString1 is not found
v.1, Mar 2007

extracts the middle of a text in between delimiters, based on a search strings and an occurrence numbers
occurrences can be positive (starting from the beginning of the text) or negative (starting from the end)
The second string will be found only after the first one.
Both string can be included or excluded with boolean parameters.

e.g : BetweenNext ( "A 1234567890 X B 1234567890 X C 1234567890 X" ; "B" ; 1 ; 1 ; "X" ; 1 ; 0 )
= "B 1234567890 "

see also Between, Before and After functions
*/

Let ([
_occurrence1 = Case ( occurrence1 = 0 ; 1 ; occurrence1 )
; _occurrence2 = Case ( occurrence2 = 0 ; 1 ; occurrence2 )

; _start = Position ( text ; searchString1 ; Case ( _occurrence1 < 0 ; Length ( text ) ; 1 ) ; _occurrence1 )
; _rightText = Replace ( text ; 1 ; _start + Length ( searchstring1 ) -1 ; "" )
; _end = Position ( _rightText ; searchString2 ; Case ( _occurrence2 < 0 ; Length ( _rightText ) ; 1 ) ; _occurrence2 ) + Length ( searchstring2 ) -1
; _result = Case ( include1_1 ; searchstring1 ) & Left ( _rightText ; _end - Case ( not include2_1 ; Length ( searchstring2 )))
]
;
Case ( _start and _end ; _result )
)

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

digg this page | del.icio.us this page

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. PVofFV ( FutureVal , Interest , Term )
  (Sat, May 10, 6:52pm)
2. Edate ( thedate ; months )
  (Sat, May 10, 5:21pm)
3. FormatDate( DatetoFormat )
  (Thu, May 08, 6:05pm)

RSS Feed of Custom Functions

Quick Poll...
Are you mainly Mac
or mainly Windows?
 • Mac
 • Windows
View the answers

FileMaker Encryption

Easily encrypt sensitive data in your FileMaker solution without a plug-in. Click here.

Custom Function Authors:
Link to all of your own custom functions on this site with the following URL:
http://www.briandunning.com/filemaker-custom-functions/results.php?author=Your Name Here