0
votes
0
comments
24,984
views

regular expression to allow spaces between words

0 votes, 0.00 avg. rating (0% score)
I want a regular expression that prevents symbols and only allows letters and numbers. This regex works great but it doesn’t allow for spaces between words. ^[a-zA-Z0-9_]*$ For example, when using this regular expression “HelloWorld” is fine but “Hello World” does not match. How can I tweak it to allow spaces?
0
votes
0
comments
3,805
views

Writing a tokenizer in Python

0 votes, 0.00 avg. rating (0% score)
I want to design a custom tokenizer module in Python that lets users specify what tokenizer(s) to use for the input. For instance, consider the following input: Q: What is a good way to achieve this? A: I am not so sure. I think I will use Python. I want to be able to provide […]