Regular Expressions

classic Classic list List threaded Threaded
3 messages Options
Keith Bates Keith Bates
Reply | Threaded
Open this post in threaded view
|

Regular Expressions

I have a text document that contains various mark up tags such as
</verse>. It s a list of song lyrics from OpenLP.

I want to strip off all the tags- the <,> and the text between. I know
search and replace with Regular Expressions will do it for me, but I
have a brain block when it comes to Reg Ex.

Can somebody please tell me how to do this?

Thank you.


--
*Keith Bates**

**Senior Pastor

*p: 02 67924890

s: 4 Mooloobar St
     Narrabri, NSW 2390
w3w: checklist.windsurf.partly

e: [hidden email] <mailto:[hidden email]>

w: www.new-life.org.au <http://www.new-life.org.au>

*
*


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Brian Barker Brian Barker
Reply | Threaded
Open this post in threaded view
|

Re: Regular Expressions

At 11:13 10/05/2019 +1000, Keith Bates wrote:
>I have a text document that contains various mark up tags such as
></verse>. It's a list of song lyrics from OpenLP. I want to strip
>off all the tags- the <,> and the text between. I know search and
>replace with Regular Expressions will do it for me, but I have a
>brain block when it comes to Reg Ex. Can somebody please tell me how
>to do this?

Search for: <[^>]*>
Replace with: (nothing)

Explanation:
[^>] matches any character except ">".
[^>]* matches zero or more of such characters.
<[^>]*> matches "<", any text not including ">", and ">", i.e.
everything from "<" up to and including the first ">" thereafter.

I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Keith Bates Keith Bates
Reply | Threaded
Open this post in threaded view
|

Re: Regular Expressions

Thank you, Brian.

That was exactly what I needed

Keith


On 10/5/19 1:46 pm, Brian Barker wrote:

> At 11:13 10/05/2019 +1000, Keith Bates wrote:
>> I have a text document that contains various mark up tags such as
>> </verse>. It's a list of song lyrics from OpenLP. I want to strip off
>> all the tags- the <,> and the text between. I know search and replace
>> with Regular Expressions will do it for me, but I have a brain block
>> when it comes to Reg Ex. Can somebody please tell me how to do this?
>
> Search for: <[^>]*>
> Replace with: (nothing)
>
> Explanation:
> [^>] matches any character except ">".
> [^>]* matches zero or more of such characters.
> <[^>]*> matches "<", any text not including ">", and ">", i.e.
> everything from "<" up to and including the first ">" thereafter.
>
> I trust this helps.
>
> Brian Barker
>
>
--
*Keith Bates**

**Senior Pastor

*p: 02 67924890

s: 4 Mooloobar St
     Narrabri, NSW 2390
w3w: checklist.windsurf.partly

e: [hidden email] <mailto:[hidden email]>

w: www.new-life.org.au <http://www.new-life.org.au>

*
*


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy