i'm looking for a regex to pick the fist word of a textbox in a game.
Example:
James
Hello my friend, how are you?
I would like to know a regex that picks "JAMES" from that example. So it has to pick the first word, and only if there is a linebreak after it.
How would you recommend me to do it?
I already tried ^. :
but it only works whenever the name has a colon at the end (James:)
CodePudding user response:
Maybe this REGEXP would help you
(.*[\n\t])
You can test it on this web page
If you are looking for a regex that has only one word then you can use ^\w $