Android Question Regex.Matcher - Single Occurance of a Char?

DonManfred

Expert
Licensed User
Longtime User
I´m not really good at regex... But maybe
B4X:
^(\w*)(\s)(\w*)$
one word, one space, one word (for Ex. Manfred Ssykor)
?
 
Upvote 0

JohnD

Active Member
Licensed User
Longtime User
Actually, I gave you the wrong specification for what I needed. You answered my question perfectly. However, what I should have said is "I need the user to be able to enter 1 and only 1 embedded space...and the embedded space is optional, not required." Is there a way to make that embedded space optional? Thanks again Manfred. JD.
 
Upvote 0

bparent

Member
Licensed User
Longtime User
Actually, I gave you the wrong specification for what I needed. You answered my question perfectly. However, what I should have said is "I need the user to be able to enter 1 and only 1 embedded space...and the embedded space is optional, not required." Is there a way to make that embedded space optional? Thanks again Manfred. JD.


Try ^(\w*)(\s?)(\w*)$
 
Upvote 0
Top