verbal_expressions
verbal_expressions copied to clipboard
'exactly' instead of 'find' ?
Just a thought. Haven't even used this library yet but I'm looking forward to it :+1:
Thanks! I hope you like it!
I like exactly
. I was also considering next
. Thoughts?
next
is another good one. a great synonym for then
from the original
library. isn't next
a reserved word in ruby though?
On Mon, Aug 5, 2013 at 5:08 PM, Ryan Endacott [email protected]:
Thanks! I hope you like it!
I like exactly. I was also considering next. Thoughts?
— Reply to this email directly or view it on GitHubhttps://github.com/ryan-endacott/verbal_expressions/issues/2#issuecomment-22147525 .
Oh, oops. You're correct. It's reserved. Maybe match
? I think I probably prefer exactly
though.
match
is cool too. Or maybe expect
? then_exactly
? Now that you mention match
, I think that's my favorite.
If I'm trying to create the regex /http/
, when I read exactly 'http'
, that makes me picture a regex more like /^http$/
, you know? As in "This string is exactly 'http'." Compared to "This string matches 'http'."
Anyway, I'm bowing out at this point. Changing the syntax is not a decision to take lightly. I suppose you could do both -- keep find
as an alias for match
so no one gets upset.
Thanks for your effort putting this together!
Of course, when implementing match
I ran into another error. Because of the way the DSL is implemented, it overrides the match
method on the regex object itself. Know of any way to reorganize it where that wouldn't be an issue? Maybe I can reassign match
to call super.match
after initialization.
I do plan on keeping the alias though.
You're welcome, I'm glad you like it! Thanks for your help!
Then >
" Its meaning is very similar to that of following or later, but it has a more formal tone to it and may imply that something not only follows but in some way grows out of or is otherwise closely connected with what precedes.
- subsequently
- consequently
This happens after
that.
This happens subsequent
to that
First do this. After
do that.
Do this. Do that.
Suppose or Should might work if the results would always be uncertain in some way:
If this is true, do this.
If this works out, it should
do that.
If this happens, then this is suppose
to happen
If this happens, suppose
this
"your choice in such cases would depend upon whether you want to stress the order of events or the causal relationship between one event and another.
It would help if you were able to describe in sentence form what is happening here:
add("(?:[^#{value}]*)")
Also, standardize
might syntactically work better than sanitize
. You're not really cleaning anything as much as you are making it works regardless of environment.