Download the PHP package selvinortiz/flux without Composer

On this page you can find all versions of the php package selvinortiz/flux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flux

FLUX (Fluent Regex) 0.5.2

Build Status Total Downloads Latest Stable Version

by Selvin Ortiz

Description

Fluent Regular Expressions in PHP inspired by and largely based on VerbalExpressions:JS by Jesse Luoto

@see inspiration & credits below for more info.

Requirements

Install

Flux is available as a package via composer

You can additionally clone/download this repo and do whatever you want: )


@Example

This simple example illustrates the way you would use flux and it's fluent interface to build complex patterns.

For other examples, please see the /etc directory.


@Changelog


0.5.2


0.5.1


0.5.0 (Beta)


0.4.5


0.4.0


0.3.0

Thought hard about changing the name to FluentX any thoughts?


0.2.0


0.1.0 (Alpha)

Initial preview release


@Todo

FLUX API

The flux API was designed to give you a fluent chainable object to build patterns with.

startOfLine()

Adds a beginning of line ^ modifier

endOfLine()

Adds an end of line $ modifier

find( $val ) & then( $val )

Allows you to augment the pattern with a required segment and it escapes regular expression characters

maybe( $val )

Allows you to augment the pattern with an optional segment

any( $val ) & anyOf( $val )

Allows you to create a set of characters to match

anything()

Adds a wild card (.*) segment to the pattern but it does not make dotAll() explicit

anythingBut( $val )

Will match anything but the characters in $val which is opposite of any() and anyOf

br() & lineBreak()

Allows you to match a new line (DOS/Unix)

tab()

Adds a (\t) to the pattern which will match a tab

word()

Adds (\w+) to the pattern which will match a single word

letters( $min=null, $max=null )

Only matches characters in the alphabet and uses $min and $max to create a quantifier

digits( $mix=null, $max=null )

Only matches digits and uses $min and $max to create a quantifier like word()

range( $from, $to [, $from, $to ...])

Allows you to create a range character class like a-z0-9 by calling range('a', 'z', 0, 9)

orTry( $val='' )

Allows you to create OR cases (this)|(else) and retain the capturing order to use in replace()

ignoreCase() & inAnyCase()

Adds the i modifier to the pattern which will allow you to match in a case insensitive manner

matchNewLine() & dotAll()

Adds the s modifier to the pattern which will allow you to match a new line when using anything()

multiline()

Adds the m modifier to the pattern which will allow you to search across multiple lines

oneLine() & searchOneLine()

Removes the modifier added by multiline() if it was previously called

match( $subject )

Simply takes your $subject in, compares it against the pattern, and returns whether a it matched or not

replace( $replacement, $subject )

You can replace matched segments by using the $x format where x is the (int) position of the matched segment

getPattern()

Returns the compiled pattern which you can also get by using the flux instance in a context where __toString() will be called

clear()

Clears the created pattern along with the modifiers, prefixes, and suffixes


Flux Elsewhere

There is a straight port of Flux for NodeJS by James Brooks whom has also collaborated on this project.

Feedback

This is something that started as a weekend experiment but I would love to take it further so if you have any suggestions, please fire away!

The best way to get in touch with me is via twitter @selvinortiz we'll take if from there :)

Contributing

  1. Check for open issues or open a new issue for a feature request or a bug
  2. Fork this repo to start making your changes to the dev branch or branch off
  3. Write a test which shows that the bug was fixed or that the feature works as expected
  4. Send a pull request and bug me until I merge it or tell you no cigar; )

Inspiration & Credits

This project is inspired and largely based on VerbalExpressions:JS by Jesse Luoto whom on July 20, 2013 started a weekend project that generated a lot of interest in the developer community and that project has proven to have a lot of potential.

Flux is not a straight port of VerbalExpressions but if you're interested in a straight VerbalExpressions port for PHP you should checkout VerbalExpressions:PHP by Mark Wilson

VerbalExpressions has also been ported to Ruby, Java, Groovy as of this update (July 25, 2013).

For a little background as to why flux was created and why you should use it, please refer to Issue #7 for a discussion on that matter.

MIT License

Flux is released under the MIT license which pretty much means you can do with it as you please and I won't get mad because I'm that nice; )


All versions of flux with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package selvinortiz/flux contains the following files

Loading the files please wait ....