Timeline for answer to regexp replace Java by Basil Bourque
Current License: CC BY-SA 4.0
Post Revisions
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 17, 2020 at 5:37 | history | edited | Basil Bourque | CC BY-SA 4.0 |
added 163 characters in body
|
| Jun 17, 2020 at 5:31 | comment | added | Basil Bourque |
@wumpz Yes, technically speaking, the String::split method takes a regex as its argument. But in this context, that distinction is transparent to the calling programmer. Effectively, we are just passing the delimiter found in the input text. The distinction you are making would be significant only if the delimiter were coincidentally fitting the syntax of a regex — that scenario is highly unlikely.
|
|
| Jun 17, 2020 at 5:28 | history | edited | Basil Bourque | CC BY-SA 4.0 |
added 381 characters in body
|
| Jun 17, 2020 at 4:46 | comment | added | wumpz | Split uses regexp as well ( at least for complex splitting expr ). Imho this short \w+ answer is more concise and deals with more delimiter variants. | |
| Jun 17, 2020 at 1:54 | history | edited | Basil Bourque | CC BY-SA 4.0 |
added 45 characters in body
|
| Jun 17, 2020 at 1:47 | history | answered | Basil Bourque | CC BY-SA 4.0 |