Jump to content

Recommended Posts

Posted (edited)

Not sure what you mean? A regex string is a text string, it's the format of that string that defines what the regex query finds as a match. Do you mean that you have a string literal which you want to convert to a regex query so that regex returns all matches of that exact string? If the string contains only alphanumeric characters, you don't need to change it. If however it contains special characters (punctuation), then you'll need to escape them, either by placing a backslash before each special character or wrapping the entire string in \Q...\E, i.e. to find "this. is. sparta!" you could wrap it like so: "\Qthis. is. sparta!\E" and regex would treat everything between \Q...\E as literal.

 

EDIT: this website was a god send when I started using regex: http://www.regular-expressions.info/tutorial.html

Edited by LosOjos
Posted

I mean I want to convert a string of text (a sentence or so) to a REGEX expression that will get matched, and independent of case.

 

I dont really want to have to learn regex, i just want to be able to unput a bunch of words, and it to out put the regex, eg is \ required before a space, or is it a . ?

@zag, got a link plz? Google shows a mulititude...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...