Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word Boundaries #6

Closed
jbrooksuk opened this issue Jul 25, 2013 · 3 comments
Closed

Word Boundaries #6

jbrooksuk opened this issue Jul 25, 2013 · 3 comments

Comments

@jbrooksuk
Copy link

There should be a method for wrapping words in \bword\b boundaries boundary and perhaps a beginBoundary and endBoundary method too.

@selvinortiz
Copy link
Owner

What do you think about word( $stric=false )?

If you call word(true) it will add (\b\w+\b) something along those lines rather than having to call another method which can get a little too verbose. Maybe we do need beginBoundary so we can apply it to other methods but I'm not sure.

@jbrooksuk
Copy link
Author

What about expressions such as \bHello\b? Having a beginBoundary and endBoundary which would be called internally too could work.

@selvinortiz
Copy link
Owner

I have to think about this because I don't want to have two methods that have a single purpose but we do need to support word boundaries... I'll run some benchmarch tests between then() which generates (Hello) and the hypo word( $val='' ) which now yield (Hello) but we can change that to yield (\bHello\b) instead since the name of the method is word singular and not words maybe the default behavior should be a bounded words?

I would appreciate your thoughts on this and a couple of use cases as that we'll help me figure out and think through what the best option would be here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants