regular expressions

K

Kevin Austin

I'm writing a script that is looking through a file for the following
lines


*something*


and replacing it with


*something* - info about the something


my problem is that I can't find info about searching for the "*"
character.

I've been reviewing the regular expression docs and can only find the
usage for "*" and not how to search for *#{stuff}*

any help would be great.
 
J

Jesús Gabriel y Galán

I'm writing a script that is looking through a file for the following
lines


*something*


and replacing it with


*something* - info about the something


my problem is that I can't find info about searching for the "*"
character.

I've been reviewing the regular expression docs and can only find the
usage for "*" and not how to search for *#{stuff}*

* is a special character for regular expressions, so you have to escape it:

/\*something\*/

Jesus.
 
K

Kevin Austin

Jesús Gabriel y Galán said:
* is a special character for regular expressions, so you have to escape
it:

/\*something\*/

Jesus.

Knew it was something stupid

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top