About Question enthuware.ocpjp.v7.2.1426 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
ETS User

About Question enthuware.ocpjp.v7.2.1426 :

Post by ETS User »

Do we need to escape "\\d\\d"?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by admin »

No, the additional '\' is required only when you are using a special character within a string in the code. For example, "\\t is for tab". If you don't put \\ here, you will get " is for tab".
If you like our products and services, please help us by posting your review here.

ArnobDe
Posts: 8
Joined: Tue Jan 27, 2015 3:33 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by ArnobDe »

0 12 followed by 3d dc 2a b2 3 [matching 2 characters at a time] then please explain 9 23 :?:

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by admin »

Not sure what is your question. The pattern matches 2 consecutive digits not just any two characters.
If you like our products and services, please help us by posting your review here.

jagoneye
Posts: 97
Joined: Wed Dec 28, 2016 9:00 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by jagoneye »

admin wrote:No, the additional '\' is required only when you are using a special character within a string in the code. For example, "\\t is for tab". If you don't put \\ here, you will get " is for tab".
What? It runs fine with a single '\' in this statement for example:

Code: Select all

System.out.println("\t yosha");
Output:

Code: Select all

	 yosha
you can use single '\' for special characters like
b t n r " ' \.
Only for regex you need to escape the '\' because '\s' is required for example but in
Java String you need to escape '\' with '\' hence the String will be '\\s'.
Hope I'm not wrong. :)

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by admin »

You are right \\ is only required in a string for regex patterns because you want to let \ be a part of the regex.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

jagoneye
Posts: 97
Joined: Wed Dec 28, 2016 9:00 am
Contact:

Re: About Question enthuware.ocpjp.v7.2.1426 :

Post by jagoneye »

admin wrote:You are right \\ is only required in a string for regex patterns because you want to let \ be a part of the regex.
thank you for your feedback!
You are welcome. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests