Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8530341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:14:05+00:00 2026-06-11T09:14:05+00:00

I have some text like this: This is some text Z书. This is Zsome

  • 0

I have some text like this:

This is some text Z书. This is Zsome more text Z计算机.
This is yet some more Z电脑 text Z.

I need to delete all cases matching the pattern Z+(CJK), where (CJK) is any number of continuous CJK characters. The file above would become:

This is some text . This is Zsome more text .
This is yet some more  text Z.

How can I delete all CJK text matching this pattern?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:14:06+00:00Added an answer on June 11, 2026 at 9:14 am

    You can using GNU sed to check the codes of non-ASCII characters:

    sed -n l0 file.txt
    

    Results:

    This is some text Z\344\271\246. This is Zsome more text Z\350\256\241\347\256\227\346\234\272.$
    This is yet some more Z\347\224\265\350\204\221 text Z.$
    

    Then you can use GNU sed to do the replacement you desire. In my testing I had to set my locale to POSIX:

    LC_ALL="POSIX" sed -r 's/Z[\o200-\o377]+//g' file.txt
    

    Results:

    This is some text . This is Zsome more text .
    This is yet some more  text Z.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have some xml like this: <mynode> <mysubnode> <mysubsubnode>hello world</mysubsubnode> some more text
I have some text inside $content var, like this: $content = $page_data->post_content; I need
all! I have a text like this Some text with uri http://test.com and other
I have some text like this: ABCPQR01 is not at all good EFHSTU39 is
I have some text like this: i18n_en_it_IT.xml:<li>risalire all&\#39;autore.</li> and like this (note the escaped
I have some text like this: এর জন্য বুদ্ধির (Reason) প্রয়োজন নেই, প্রয়োজন নিজের
I have some text that is stored in a variable like this: <div class=foo>text
Hey, I have some text that is formatted like this: [quote]foo text[/quote] and I
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
I have some HTML like this: <input type=radio class=MyRadio name=TheName> <label for=TheLabel>the text</label> How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.