Hafeez Pallikonda Khader wrote:The below code gives me wrong result. Basically i want only a-z and _ as the starting character
output is 1998St which is wrong
Hafeez Pallikonda Khader wrote:Its not about special characters at the start. Please look at my edited code.
Hafeez Pallikonda Khader wrote:Sure. I'll open a new post with the code
Hafeez Pallikonda Khader wrote:
The below code gives me wrong result. Basically i want after replace all operation.
letters(a-z) and Underscore(_) as the starting character Following that, there can be letters(a-z), numbers(0-9), Underscore(_), Hyphen(-) and period(.)
Richard Tookey wrote:
Though I can't be certain because I'm still not certain what the OP wants, I think replaceAll() is the wrong method to use. I think find() should be used with regex "([a-z_][a-z0-9_-.]*)" with group(1) giving the desired result.
Henry Wong wrote:[
Maybe we are speculating on what the OP wants differently, but I think the original code should work. It just needs a slight change to the regex. Here...
Henry
Consider Paul's rocket mass heater. |