Regex for quotation marks.

Anonymous
Offline Anonymous

I would like to add some regex into my QA checker to search for quotations mark such as
"
«
»

And those alternatives with spaces too.

I do not know if someone can help me with this but even after a some research, it does not seem to work. Any suggestion on Regex to search these items in a sdlxliff file?

Thank you very much for you help!

Parents
  • All these in one file? Well, that can be a bit complicated, as the German ones do NOT require spaces, while the French ones do.
    For example to run a Sarch & Replace for straight quotes to German ones run these two operations:
    Search: (")([a-z0-9])
    Replace: „$2
    Search: ([a-z0-9]\b)(")
    Replace: $1“

    In the QA checker I have added the straight quotes directly as forbidden elements. This finds all remaining, for example such between tags or similar.
  • Anonymous
    0 Offline Anonymous in reply to Jerzy Czopik
    Thank you so much for your reply.

    What I am actually looking for is a search in the target only, no matter how it is in the source (for QA purposes): I only want to use the following quotation marks: «» without spaces (example: «XXXX»).

    I thus want to search for all other types of quotation marks in my text :
    - "xxxxxxxxx" (without spaces)
    - " xxxxxxxxx " (with spaces)
    - « xxxx » (with spaces)

    I am sorry but I am really not familiar with Regex and I tried to learn a bit. Other types of regex were easier to write but I could not figure out how to write them.

    Since you talk about "Search and Replace", do you know if there is a way to do a find and replace of various things at the same time. For example, clicking on button to replace the quotation marks, the double spaces and so one. If I am right, QA Checker only informs you of a mistake but does not correct it automatically.

    Once again, thank you so much for your help.
  • Hi Marine,

    This should do it:

    - Go to Verification - QA Settings - Regular Expressions

    - Give your new rule a name under Description

    - Leave the RegEx source empty

    - In the RegEx target, enter the following:

    "|" | "|« | »

    (Note there are spaces after or before the quotes from the second one on)

    - In the Condition dropdown list, choose Report if target matches (target check only)

    - In the Action dropdown button, select Add Item. Click OK.

    And you're right, the above will tell you when one of the wrong forms is present but it won't replace them. You would need to run a separate find and replace operation for that.
Reply
  • Hi Marine,

    This should do it:

    - Go to Verification - QA Settings - Regular Expressions

    - Give your new rule a name under Description

    - Leave the RegEx source empty

    - In the RegEx target, enter the following:

    "|" | "|« | »

    (Note there are spaces after or before the quotes from the second one on)

    - In the Condition dropdown list, choose Report if target matches (target check only)

    - In the Action dropdown button, select Add Item. Click OK.

    And you're right, the above will tell you when one of the wrong forms is present but it won't replace them. You would need to run a separate find and replace operation for that.
Children