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

Ansicht von 2 Beiträgen - 1 bis 2 (von insgesamt 2)
  • Autor
    Beiträge
  • indmore
    Teilnehmer
    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

    • Diese Antwort wurde geändert vor 5 Jahren, 5 Monaten von .
Ansicht von 2 Beiträgen - 1 bis 2 (von insgesamt 2)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.