home Forums idx general support How can I do RegEx search and replace in the Editing window?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • indmore
    Participant
    Post count: 3

    I would like to create new sorting specifications for a group of entries, e.g.,

    1,1,1-Trichlor-2,2-bis-(4-chlorphenyl)ethan
    1,1,1-Trichlorethan
    to
    1,1,1-Trichlor-2,2-bis-(4-chlorphenyl)ethan;Trichlor-2,2-bis-(4-chlorphenyl)ethan1,1,1-
    1,1,1-Trichlorethan;Trichlorethan1,1,1-

    indexmanager
    Moderator
    Post count: 31

    We figured it out. The regular expression for this particular task is (don’t forget to activate rx and select the appropriate column):
    Search:(^[0-9-,]+)(.*) and Replace: \1\2;\2\1
    If the function is used frequently, it is useful to create a new function in the “Index-Action” window. Or save the regular expression in the notes window if you want to apply the action in the “Edit” window.
    These two links to regex are very good, especially the test platform for creative testing.
    Table: http://www.cbs.dtu.dk/courses/27610/regular-expressions-cheat-sheet-v2.pdf
    Test-page: https://regex101.com

    • This reply was modified 5 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.