Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Find Occurrences of Word in Sentence
DiYane
Sep 27th, 2023
906
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Python
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
import
re
some_string
=
input
(
)
searched_word
=
input
(
)
pattern
=
fr
'
\b
{searched_word}
\b
'
mathes
=
re
.
findall
(
pattern
,
some_string
,
flags
=
re
.
I
)
print
(
len
(
mathes
)
)
Tags:
python
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
⭐ Free $$$ Mehtod
CSS | 2 min ago | 0.71 KB
✅ Instant Profits with Crypto
CSS | 4 min ago | 0.71 KB
2 Day in +12.000$ ⭐
CSS | 9 min ago | 0.71 KB
Free money docs
CSS | 11 min ago | 0.71 KB
⭐ Free $$$ Mehtod
CSS | 12 min ago | 0.71 KB
⭐ Free $$$ Mehtod
CSS | 22 min ago | 0.71 KB
2 Day in +12.000$ ⭐
CSS | 23 min ago | 0.71 KB
⭐ Free $$$ Mehtod
CSS | 32 min ago | 0.71 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!