#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0

    Remove last character (symbol | )


    Hi everyone,
    I work with biological data and I have to remove this symbol | and I can't catch only the final |
    For example:

    Silva, A. G. |

    Reis, R. B. | Costa, M. C. A. (in this case I want to keep it)

    Braz, G. S. |

    Any suggestions?

    Thank you very much
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,825
    Rep Power
    9646
    Code:
    \|$
    If there could be whitespace after the pipe then add in an \s*.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0
    Hi again,

    I would like to find any word with all upper case letters

    Ex: SILVA, D.S, MENDOÇA

    I need to catch SILVA and MENDOÇA

    Thanks!
  6. #4
  7. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,825
    Rep Power
    9646
    What have you tried and how has it not worked?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2017
    Posts
    3
    Rep Power
    0
    Originally Posted by requinix
    What have you tried and how has it not worked?
    Thanks for answering. The solution you gave me "\|$" worked.

    Now, I want to catch Upper case words. No clue how to start.

    Thanks
  10. #6
  11. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,825
    Rep Power
    9646
    Okay. Have you looked into regular expressions in these last... jeez, 9 months? Uppercase is pretty easy to get words like SILVA with simple Latin letters, but takes a little more work for something like MENDOÇA.

    Can you come up with a regex that gets SILVA? It'll probably get D and S too but that's okay to start with.

IMN logo majestic logo threadwatch logo seochat tools logo