There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ren Rem wrote:Actually it's looking for two or more backslashes at the start followed by the letters "GET" ...
Tiya Khambadkone wrote:
My requirement is
Change "\*\*GET" to "\*\*POST" throughout a file
Sorry, I just saw that there is no caret and no double backslashes.
when I copied the string to my java IDE then automatically another backslash got appended.
Tiya Khambadkone wrote:
I am trying to store the value from database into a string and then I want to use replaceAll(string1, string2). However, i don't understand the meaning of the regular expression.
Henry Wong wrote:
You might want to consider using the replace() method, that takes two strings, instead. It looks like you are trying to replace a value with another value, *and* you don't understand regular expressions. So, why use regular expressions, when you don't have to?
Tiya Khambadkone wrote:
My job is to get the regular expression from the database. In this case it is \*\*GET Then, I will get a 100 MB file and I have to replace this regular expression with another regular expression \*\*POST
My requirement is
Change "\*\*GET" to "\*\*POST" throughout a file
Tiya Khambadkone wrote:I can't change my requirement.
Tiya Khambadkone wrote:I get these regEx values from Database. In database table it is varchar2 with value \*\*GET.
Now it is left upto me to decide ,how I need to fetch these values from database and use it in my code.
Tiya Khambadkone wrote:True. I don't need to understand the regularExpression and so I wrote :
Tiya Khambadkone wrote:My job is to get the regular expression from the database. In this case the value in a database table is \*\*GET which is varchar2.
Then, I will get a 100 MB file and I have to replace this regular expression with another regular expression \*\*POST and this value(varchar2) will again be fetched from the database.
My requirement is
Change "\*\*GET" to "\*\*POST" throughout a file
Tiya Khambadkone wrote:My requirement is
Change "\*\*GET" to "\*\*POST" throughout a file
So, if I want to understand the meaning of \*\*GET then can anyone confirm me if it is nothing but 2 asterisks followed by GET or anything else? If anything else then what is the other possibility.
Tiya Khambadkone wrote:are you saying it is not even a regular expression?
If yes, then that is not correct.
It is a regular expression.
Tiya Khambadkone wrote:\*\*GET should match to **GET
Just found out this answer.
Everybody's invited. Except this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|