Closed bessone closed 5 years ago
Hi. What kind of responses contains dash in states? Don't see on issue examples...
Anyway. I guess better to trim result for spaces and dash instead of fix regex Looks like more reliable. What you think?
As @deepika-maj said in #80, try the tessaana.com domain
I have to try some domains, but I'm pretty sure some registry don't have states in a single string, but they are sentences with spaces. Removing all the text after the first space with a regex is not the solution, but surely you can think of a better regexp, but you should have more cases of answers to be sure. My idea is that a small change so far may suffice for a refactoring in the future.
Not exactly.
My point si keep regex as is in trim(preg_replace('~\(.+?\)|(http|<a href).+~ui', '', $state))
'someStatus - <a href=blablabla>'
--> 'someStatus - '
Now we just trim remainder (spaces and other junk)
trim('someStatus - ', ' -\t')
=> 'someStatus'
So fix become to trim(preg_replace('~\(.+?\)|(http|<a href).+~ui', '', $state)
, ' -\t')
Ok, understood! I think is pretty similar, remove the dash with the regex or remove it later with a trim. Maybe do it in the regex is a bit faster (ok, we talk about micro/milliseconds.... :D) I think we can trim the spaces in the regex also.
Well, regex contains 2 parts and dash only in second. So if we got something like 'myStatus - (bla bla bla)'
it becomes to 'myStatus - '
So trim can handle that case and keep regex more readable.
I mean only that (not slower/faster) :D
Anyway we have only one example so no matter what fix will be pushed
For me is the same, as you prefer! (and meanwhile I look forward to the day that RDAP will become a standard used by all)
Small change to the regex to handle the dash.