Skip to main content
as suggested by @eldo
Source Link
Syed
  • 62.9k
  • 5
  • 48
  • 103
test = "word 123 456 123 7890.000 0.12000" StringSplit[test , Whitespace]StringSplit[test] // Select[IntegerQ@*ToExpression] SemanticImportString[test] // Normal // First // Select[IntegerQ] // Map[ToString] With [{t = TextWords[test]}, t // StringContainsQ[Except[DigitCharacter]] // Pick[t, #, False] &] 

{"123", "456", "123"}

test = "word 123 456 123 7890.000 0.12000" StringSplit[test , Whitespace] // Select[IntegerQ@*ToExpression] SemanticImportString[test] // Normal // First // Select[IntegerQ] With [{t = TextWords[test]}, t // StringContainsQ[Except[DigitCharacter]] // Pick[t, #, False] &] 

{"123", "456", "123"}

test = "word 123 456 123 7890.000 0.12000" StringSplit[test] // Select[IntegerQ@*ToExpression] SemanticImportString[test] // Normal // First // Select[IntegerQ] // Map[ToString] With [{t = TextWords[test]}, t // StringContainsQ[Except[DigitCharacter]] // Pick[t, #, False] &] 

{"123", "456", "123"}

Source Link
Syed
  • 62.9k
  • 5
  • 48
  • 103

test = "word 123 456 123 7890.000 0.12000" StringSplit[test , Whitespace] // Select[IntegerQ@*ToExpression] SemanticImportString[test] // Normal // First // Select[IntegerQ] With [{t = TextWords[test]}, t // StringContainsQ[Except[DigitCharacter]] // Pick[t, #, False] &] 

{"123", "456", "123"}