Regex problem

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
kusal
Forum Newbie
Posts: 14
Joined: Mon Oct 22, 2007 12:12 pm

Regex problem

Post by kusal »

Here is my problem

<h4 Bla Bla Bla Bla Bla Bla
Bla Bla Bla Bla Bla
Bla Bla Bla Bla Bla Bla
Bla Bla Bla Bla </h4>

I want the content between <h4> tags in a variable, using only one expressions

thnx
Kusal
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What have you tried? Have you read any of the previous examples that show how to match the content of a specific tag?
kusal
Forum Newbie
Posts: 14
Joined: Mon Oct 22, 2007 12:12 pm

Post by kusal »

I did not read previous examples,

I can do it line by line, what want is a way to ignore \n so that I can get it from one expression.

lines between <h4> tags chage, thats the problem
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What is your current pattern?
kusal
Forum Newbie
Posts: 14
Joined: Mon Oct 22, 2007 12:12 pm

Post by kusal »

I don't have a clue how to write this :cry:
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

The m modifier will look past the \n's :)
Have a look at the regex crash course part 1 by chris corbyn

That should help make your task a little bit easier.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
kusal
Forum Newbie
Posts: 14
Joined: Mon Oct 22, 2007 12:12 pm

Post by kusal »

Got it, s modifier is the one that did the trick

Thank you guys for your help :)
Post Reply