Skip to main content
added 5 characters in body
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be used with Repeat to ignore CJK strings

StringCases[
  "the quick fox...本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be used with Repeat to ignore CJK strings

StringCases[
  "the quick fox...本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}
deleted 2 characters in body
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...んは本当に日本語を勉強していますか本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...んは本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}
Added an example of use
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...んは本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This is a pretty ugly hack, but maybe it will inspire you to something better.

leastCJK = ToCharacterCode["⺀"][[1]];
StringMatchQ[#, _?(ToCharacterCode[#][[1]] < leastCJK &)] & /@ 
  {"a", "1", ".", " ", "中", "あ"}
{True, True, True, True, False, False}

Note: "⺀" is unicode character U+2E80, CJK RADICAL REPEAT

This hack can be with Repeat to ignore CJK strings

StringCases[
  "the quick fox...んは本当に日本語を勉強していますか...jumped", 
  Repeated[_?(ToCharacterCode[#][[1]] < leastCJK &)], 
  Overlaps -> False]
{"the quick fox...", "...jumped"}
added 104 characters in body
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259
Loading
Source Link
m_goldberg
  • 108.2k
  • 16
  • 104
  • 259
Loading