php - regular expressions multiple statements -


i have half problem working. problem is: need match words either 7 letters long , starting st or 9 letters long ending tion. have code works first half of question: st\w{5}\s. match 7 letter word such 'startin' in example: start startin starting.

however cant seem add second half. (st\w{5}\s)|(tion\w{5}) not work in trying find 'startin' , 'attention' out of: start startin starting attention. thanks.

you'll want word boundaries \b(?:(st\w{5})|(\w{5}tion))\b

enter image description here


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -