0
votes
2answers
21 views

Convert java string to string compatible with a regex in replaceAll [duplicate]

Is there a library or any easy way to convert a string and make sure its compatible as a regex to look for and replace in another string. So if the string is "$money" it would get converted to ...
-1
votes
2answers
47 views

Can someone tell me the regex for a dateTimeString like: “YYYY/MM/DD HH:MM:SS” [closed]

Also, I'd really appreciate an explanation. Sorry, but I have never used regexes in my life and can barely read them.
1
vote
4answers
43 views

How can detect one string contain one of several characters using java regex

I have a variable length string, I just want to detect whether this string contains several characters. For example: "sadsdd$sss^dee~" I want to detect whether this string contains ANY of the ...
1
vote
1answer
26 views

Java regex possesive quantifiers

Given this regex: x[^x]*+x and this input string for matching: xbbbx The result is the matched text xbbbx starting at index 0 and ending at index 5. But, by only changing the last letter x ...
1
vote
3answers
62 views

Unable to split String the way I want

in my Java app, I have a long JSON String with data I would like to extract. [["19:05",2,"","19.3","26.7","74","1003.6","3.2","236.0","00 : 05 : 43","01 : 54 : ...
1
vote
2answers
46 views

Java Regex for protecting xSS

I want to use java Regex to check whether there is <script/> in my url. I want to match if characters of url occur in ['"&<>\/] , But for java ,the regex is little different, I do not ...
0
votes
1answer
22 views

Java Regex Unclosed character class (PatternSyntaxException)

I am having trouble compiling a regex. I cant find what the problem is with this expression as I got it from Cisco documentation and I don't understand why it does not work. I'm hoping that somebody ...
0
votes
1answer
60 views

Formatting any string to be comma delimited

I would like to format any string to a comma delimited format. Basically, any combination of whitespaces (1 or more) EXCEPT a single space should be replaced by ", ". Here's my current method: ...
2
votes
4answers
39 views

How to replace a character at a certain index with a regular expression [closed]

Hi i a have string like this one My home is a nice home in Paris but i will go to the home of some one else. i want to replace the character i starting from index 5 to index 25 of the string with ...
3
votes
3answers
75 views

Escape double quotes within double quotes

I have a string [{"Id":"1","msg":""Lorem Ipsum""}] in which I need to just escape the quotes inside the quotes like this [{"Id":"1","msg":"\"Lorem Ipsum\""}]. I don't have access to generator code to ...
-2
votes
2answers
56 views

regular expression for more than three consecutive character

I have a requirement where I have to check String(combination of number and letter only) which Must not contain more than 3 successive characters(only character). for example: abcd - not allowed ...
0
votes
2answers
64 views

Read regex from properties file in java

I have problem reading values like (\+?\s*[0-9]+\s*)+ from properties file in java, because the value , what I get with getProperty() method is (+?s*[0-9]+s*)+. Escaping of values in properties file ...
3
votes
1answer
31 views

Java regular expression to match everything between same specific character sequences

Let's take string "Something foo part1 foo part2 foo part3" as an example. I want to find all parts starting with "foo" continuing till another "foo" or end of string and replace (wrap inner part ...
0
votes
2answers
45 views

All actions getting forwarded to the Struts2 servlet after URL rewriting

I am using struts 2 and I recently configured my web.xml and struts.xml to change the eliminate .action from the url. Gladly everything is working fine except for a major issue. I want some of my ...
0
votes
2answers
35 views

Greedy Quantifiers

I was reading K.Sierra and found the following sentance: The greedy quantifier does in fact read the entire source data, and then it works backward (from the right) until it finds the rightmost ...

1 2 3 4 5 410
15 30 50 per page