Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wanted: cf to extract string between delimiters

Featured Replies

I've looked and I can't find so please forgive if this has already been solved

I want to extract the url containing the word (or part of word) contact from a list of urls.

Here is an example of the raw list:

[23] http://192.168.0.200/FEEDBACK.HTM[24] http://192.168.0.200/ADVERTISE.HTM[25] http://192.168.0.200/CONTACTS.HTM[26]

I would like to have his returned:

http://192.168.0.200/CONTACTS.HTM

Any ideas would be appreciated (I've bashed my head against this for hours)

Cheers

Pete

It looks like you need a little creative use of the script step: Position ( text ; searchString ; start ; occurrence ).

e.g. You could run a loop that finds words beginning with "http:" and loads them into a repeating field, then you would have all the addresses in the repeating field and it would leave out any other extraneous rubbish.

If the addresses come with the "[XX]" tacked on the end, you might also want to remove this as a step in the loop too.

Anatole

It doesn't seem too difficult, but some points require clarification:

extract the url containing the word (or part of word) contact

1. What does "part of word" mean? Do words like "control" or "intact" contain part of the word "contact"?

2. Could there be more than one URL that needs to be extracted?

3. Does the number in brackets come after the URL or before it?

  • Author

I need the full word contact.

I've built a workaround for now which does the job

Make each url into a separate line by substituting the [ character for the newline character.

Using the custom function ExtractLine inside a script loop to pull each line and check it for "contact"

It's clumsy but it works for now. Can't spend all day solving one problem. I'd like to come back to it as I hate messy code.

Thanks

Pete

I need the full word contact.

Well, that answers #1, and I guess from the rest that the answer to #2 is yes - but what about #3?

  • Author

Sorry,

I'm the idiot. The number in brackets comes before the url.

Thanks

Pete

Try a custom function:

ExtractContacts ( text )


Let ( [

pos = Position ( text ; "contact" ; 1 ; 1 ) ;

start = Position ( text ; "] " ; pos ; -1 ) + 2 ; 

end = Position ( text & "[" ; "[" ; pos ; 1 ) 

] ;

Case ( pos ; 

Middle ( text ; start ; end - start )

& ¶ &

ExtractContacts ( Right ( text ; Length ( text ) - end ) )

)

)

  • Author

Thanks, Will do

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.