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.
  • Hi Nora,

    I like that you try to get these rules into one expression... but worth noting a few things to be careful with.

    1. You won't be able to make sure the correct quote is being used
    2. You won't be able to check for one space only... you could have 100 spaces and it will pick up the same result
    3. You could leave a quote out and it will report the same message (although maybe this is useful)

    I like the concept "economy of accuracy" but sometimes it pays to be a little more specific.

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

  • Anonymous
    0 Offline Anonymous in reply to Paul
    Thank you so much Paul and Nora for both your answer.

    I tested both solutions and Paul's solution is indeed more accurate. I have been working on this for awhile now and it is now working as I wanted it.

    Thanks,

    Kind regards,
Reply Children
No Data