Sign in to follow this  
Hawk

Regex question.

Recommended Posts

Hey everyone.

I am trying with Regex but I don't know how to capture a word in a text. I already made the connections etc. I only need to read the html to see if a word is in there. 

I thought this:

 

"(?=Word)\"(.*?)\""

The line I need to capture is this:

"Word  "
If "Word" is in that html source. Capture:
"WRD"

I tried almost everything, but nothing works.

Thanks for help.

Share this post


Link to post
Share on other sites

You don't need regex for that: indexOf and substring.

Share this post


Link to post
Share on other sites

You don't need regex for that: indexOf and substring.

 

That's bad. Regex us the fastest.

Share this post


Link to post
Share on other sites

Is Word always constant or will it keep changing?

Share this post


Link to post
Share on other sites

".*Word.*

 

Customize how you will, Here are the matches/captures:

 

ZNE0Jmz.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this