Regular expression: use any chars as delimiter except a-zA-z and “.”
up vote
-1
down vote
favorite
in.useDelimiter("[^a-zA-Z]+");
this expression can use any non-letter char
as delimiter
(eg, input abc@, abc will be stored; input
abc., abc will be store)
.
However, I don't want to ignore "."
because I want to use it to end the input.
How can I modify the regular expression
above?.
java regex delimiter
add a comment |
up vote
-1
down vote
favorite
in.useDelimiter("[^a-zA-Z]+");
this expression can use any non-letter char
as delimiter
(eg, input abc@, abc will be stored; input
abc., abc will be store)
.
However, I don't want to ignore "."
because I want to use it to end the input.
How can I modify the regular expression
above?.
java regex delimiter
2
Can you just include.
in the negative character set?
– CertainPerformance
Nov 11 at 4:48
2
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
in.useDelimiter("[^a-zA-Z]+");
this expression can use any non-letter char
as delimiter
(eg, input abc@, abc will be stored; input
abc., abc will be store)
.
However, I don't want to ignore "."
because I want to use it to end the input.
How can I modify the regular expression
above?.
java regex delimiter
in.useDelimiter("[^a-zA-Z]+");
this expression can use any non-letter char
as delimiter
(eg, input abc@, abc will be stored; input
abc., abc will be store)
.
However, I don't want to ignore "."
because I want to use it to end the input.
How can I modify the regular expression
above?.
java regex delimiter
java regex delimiter
edited Nov 11 at 6:09
Md. Mokammal Hossen Farnan
562319
562319
asked Nov 11 at 4:47
J.Joe
1
1
2
Can you just include.
in the negative character set?
– CertainPerformance
Nov 11 at 4:48
2
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50
add a comment |
2
Can you just include.
in the negative character set?
– CertainPerformance
Nov 11 at 4:48
2
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50
2
2
Can you just include
.
in the negative character set?– CertainPerformance
Nov 11 at 4:48
Can you just include
.
in the negative character set?– CertainPerformance
Nov 11 at 4:48
2
2
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
.
is a wildcard in regex's syntax meaning "any character". If you want to use it as a "real" character, you need to escape it with a :
in.useDelimiter("[^a-zA-Z.]+");
// Escapting here -------^
1
Actually, you don't need to escape the.
in that context (a character class). The only characters that do / might need to be escaped in a character class are^
,[
,]
,&
and-
.
– Stephen C
Nov 11 at 7:26
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
.
is a wildcard in regex's syntax meaning "any character". If you want to use it as a "real" character, you need to escape it with a :
in.useDelimiter("[^a-zA-Z.]+");
// Escapting here -------^
1
Actually, you don't need to escape the.
in that context (a character class). The only characters that do / might need to be escaped in a character class are^
,[
,]
,&
and-
.
– Stephen C
Nov 11 at 7:26
add a comment |
up vote
0
down vote
.
is a wildcard in regex's syntax meaning "any character". If you want to use it as a "real" character, you need to escape it with a :
in.useDelimiter("[^a-zA-Z.]+");
// Escapting here -------^
1
Actually, you don't need to escape the.
in that context (a character class). The only characters that do / might need to be escaped in a character class are^
,[
,]
,&
and-
.
– Stephen C
Nov 11 at 7:26
add a comment |
up vote
0
down vote
up vote
0
down vote
.
is a wildcard in regex's syntax meaning "any character". If you want to use it as a "real" character, you need to escape it with a :
in.useDelimiter("[^a-zA-Z.]+");
// Escapting here -------^
.
is a wildcard in regex's syntax meaning "any character". If you want to use it as a "real" character, you need to escape it with a :
in.useDelimiter("[^a-zA-Z.]+");
// Escapting here -------^
answered Nov 11 at 5:13
Mureinik
175k21125192
175k21125192
1
Actually, you don't need to escape the.
in that context (a character class). The only characters that do / might need to be escaped in a character class are^
,[
,]
,&
and-
.
– Stephen C
Nov 11 at 7:26
add a comment |
1
Actually, you don't need to escape the.
in that context (a character class). The only characters that do / might need to be escaped in a character class are^
,[
,]
,&
and-
.
– Stephen C
Nov 11 at 7:26
1
1
Actually, you don't need to escape the
.
in that context (a character class). The only characters that do / might need to be escaped in a character class are ^
, [
, ]
, &
and -
.– Stephen C
Nov 11 at 7:26
Actually, you don't need to escape the
.
in that context (a character class). The only characters that do / might need to be escaped in a character class are ^
, [
, ]
, &
and -
.– Stephen C
Nov 11 at 7:26
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245931%2fregular-expression-use-any-chars-as-delimiter-except-a-za-z-and%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Can you just include
.
in the negative character set?– CertainPerformance
Nov 11 at 4:48
2
What about [A-Za-z.]
– Eray Balkanli
Nov 11 at 4:50