SyntaxFix
Write A Post
Hire A Developer
Questions
🔍
[regex] regex to match a single character that is anything but a space
Home
Question
regex to match a single character that is anything but a space
\s
matches any white-space character
\S
matches any non-white-space character
You can match a space character with just the space character;
[^ ]
matches anything but a space character.
Pick whichever is most appropriate.
Examples related to
regex
•
Why my regexp for hyphenated words doesn't work?
•
grep's at sign caught as whitespace
•
Preg_match backtrack error
•
regex match any single character (one character only)
•
re.sub erroring with "Expected string or bytes-like object"
•
Only numbers. Input number in React
•
Visual Studio Code Search and Replace with Regular Expressions
•
Strip / trim all strings of a dataframe
•
return string with first match Regex
•
How to capture multiple repeated groups?