← Back to challenges

RegEx: Boundary Assertions IV

JavaScriptHardlanguage_fundamentalsregexstrings

Instructions

You've just webscraped a web page and stored it in a string. In the string there is a bullet list of states that voted for President Trump's impeachment:

const str = `
* Texas = no
* California = yes
* Florida = yes
* Michigan = no
`

Add a positive lookahead assertion so a regex match would output the states that voted yes

Notes

  • You must use a positive lookahead assertion.
  • This is fake data and used only for educational purposes.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: ASCII Charts (Part 1: Progress Bar)