24.12.2013 Views

Slides - University of Washington

Slides - University of Washington

Slides - University of Washington

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>University</strong> <strong>of</strong> <strong>Washington</strong><br />

Ling472 Introduction to Computational Linguistics<br />

Lecture 1:<br />

Introduction<br />

Capture groups<br />

• Use parentheses to ‘capture’ part <strong>of</strong> a match<br />

and copy it to the output<br />

• () creates a group you can reference<br />

• \n references the nth group<br />

• Example: to search for repeated words:<br />

([a‐z]+) \1 \1<br />

“I called kitty kitty kitty.”<br />

Monday, April 1, 2013<br />

56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!